comp • gb.pcre • regexp • submatches

RegExp.SubMatches (gb.pcre)

Property Read SubMatches As .Regexp.Submatches

A submatch is a part of your pattern contained in parentheses. For example, given the pattern "brown (\S+)", the first and only element in the SubMatches collection would be the word following "brown" in the subject text. With a subject of "quick brown fox", SubMatches[0] would contain "fox" and Submatches.Count would be 1.

The SubMatches property is now deprecated. Use the Count property and the array accessor of the RegExp class directly.