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("11/20/2008 2:39:17 PM"); |
| rr.IsMatch |
true |
| mc[0].Value = '11/20/2008' |
11/20/2008 2:39:17 PM |
| mc[0].Groups[0].Value = '11/20/2008' |
11/20/2008 2:39:17 PM |
| mc[0].Groups[0].Captures[0].Value = '11/20/2008' |
11/20/2008 2:39:17 PM |
| mc[0].Groups["dayofmonth"].Value = '20' |
11/20/2008 2:39:17 PM |
| mc[0].Groups["dayofmonth"].Captures[0].Value = '20' |
11/20/2008 2:39:17 PM |
| mc[0].Captures[0].Value = '11/20/2008' |
11/20/2008 2:39:17 PM |