I'm having trouble using regex to get a 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 matches my current line, but I would like to get, in my matchcollection, “Sep 2004” and “Oct 2004” to parse it in 2 days.
If anyone has an idea, thank you very much.
source
share