Regex usually matches strings according to the "leftmost longest"
rule; that is, it chooses the longest of the leftmost matches. This
does not mean that for a regular expression containing subexpressions
that it simply chooses the longest match for each subexpression, left to
right; the overall match must also be the longest possible one.
For example, `(ac*)(c*d[ac]*)\1' matches `acdacaaa', not
`acdac', as it would if it were to choose the longest match for the
first subexpression.
Please take a moment to fill out
this visitor survey You can help support this site by
visiting the advertisers that sponsor it! (only once each, though)