The regular expression tester shows you the values of a .NET Regex object based on an input
string and a pattern string. Named groups are supported. The pseudo-code below is based on C# expressions.
| using System.Text.RegularExpressions; |
| Regex rr = new Regex("\d+/(?<dayofmonth>\d+)/\d+"); |
| MatchCollection mc = rr.Matches("1/5/2009 9:58:51 PM"); |
| rr.IsMatch |
true |
| mc[0].Value = '1/5/2009' |
1/5/2009 9:58:51 PM |
| mc[0].Groups[0].Value = '1/5/2009' |
1/5/2009 9:58:51 PM |
| mc[0].Groups[0].Captures[0].Value = '1/5/2009' |
1/5/2009 9:58:51 PM |
| mc[0].Groups["dayofmonth"].Value = '5' |
1/5/2009 9:58:51 PM |
| mc[0].Groups["dayofmonth"].Captures[0].Value = '5' |
1/5/2009 9:58:51 PM |
| mc[0].Captures[0].Value = '1/5/2009' |
1/5/2009 9:58:51 PM |