Description:
When the Match method matches parenthetical subexpressions of a
regular expression r against a text
t, it records which parts of text they match.
It returns that information by storing the offsets into two arrays, an
array called soff that contains offsets for the start of each match and
an array eoff (see eoff)
containing offsets for the end of the match.
The elements of soff and
eoff correspond to
subexpressions positionally. The first elements of two arrays (the
element with index 1) record the part of the string that matched the
entire regular expression r. The elements
soff[i] and eoff[i]
store the start and end offsets, respectively, for the match of the i-th
subexpression of r in
t. If entire regular expression
r did not match,
soff[1] and eoff [1]
are zero. If the i-th subexpression did not match, the returned offsets
are zero.
The offsets use the following convention: The start and end offsets of
the string "na" in the text "abnacc" are 3 and 5,
respectively. The end offset is the index corresponding to the last
character of the string plus one.
If you don't want regexec to return any information about where the
subexpressions matched, you can supply the nosub flag to the class
constructor. |