Hi
I want to search for all possible dates in a string using Regex. In my code i have this:
String dateSearchPattern = @"(?<Day>\d{2}).(?<Month>\d{2}).(?<Year>\d{4})|(?<Day>\d{2}).(?<Month>\d{2}).(?<Year>\d{2})";
// date format: dd.mm.yyyy or d.m.yyyy or dd.mm.yy or d.m.yy
String searchText = "20.03.2010.25.03.10";
Regex.Matches(searchText, dateSearchPattern); // the matching SHOULD give a count of 2
The above code gives only 1 match where it should give 2. Also i need to have a patthern when the date format is like d.m.yyyy or d.m.yy.