Hi,
Are you looking for below code ?
string str = "3/33/3333";
Regex regex = new Regex(@"(?<month>\d{1,2})/(?<day>\d{1,2})/(?<year>(?:\d{4}|\d{2}))",
RegexOptions.IgnoreCase
| RegexOptions.Multiline
| RegexOptions.IgnorePatternWhitespace
| RegexOptions.Compiled
);
Match m = regex.Match(str);
var abc = m.Groups["Day"].Value;
in above code
abc
will gives you desired result.
above code is take from
this
Thanks
-Amit