[Solved] Extract a date from a text [closed]


How about something like this? It would only handle one specific format but the regex can be adjusted for other formats.

Regex rg = new Regex(@"[01]?\d[/-][0123]?\d[/-]\d{2}");
Match m = rg.Match(string);
m.ToString();

Here is a question with a bunch of date regexes that may help. Regular Expression to match valid dates

solved Extract a date from a text [closed]