Get matching substring |
![]() |
|
|
|
|
|
This method can be called after a successful regular expression search was completed (see Regexp::Match)
GetCompleteMatch will return the substring that matches the entire regular expression. To return individual matching groups within this substring, see GetMatch.
A source code example can be found in the overview.
|
|
|
|
|
This form of GetCompleteMatch operates like the previous one, but instead of returning a string object, it will store a pointer to the beginning of the matching substring in start, and to the first character after the end of the matching substring in end Thus, it is easy for the caller to continue looking for additional matches in the same master string. Also, by subtracting the original string pointer from start and/or end, the caller can identify the character offsets of the matching substring.
See also: Regular expression classes, Regular expressions overview