GetDate in a string in c#
- by Doncho
Hi,
I'm having some trouble using regular expression to get date in a string.
Example :
string text = "75000+ Sept.-Oct. 2004";
MatchCollection dates = Regex.Matches(text, @"[0-9]{5,}[+][\s](jan|feb|fev|mar|apr|avr|may|mai|jun|jui|jul|jui|aug|aoû|sept|oct|nov|dec)[\.][\-](jan|feb|fev|mar|apr|avr|may|mai|jun|jui|jul|jui|aug|aoû|sept|oct|nov|dec)[\.]\s[0-9]{4}", RegexOptions.IgnoreCase);
This code is matching with my current string but i would like to get in my matchcollection, "Sept 2004" and "Oct 2004" in order to parse it in 2 datetime.
If anyone have any idea, thanks a lot.