|
Posted by Chung Leong on 07/17/06 16:33
Rik wrote:
> Ah, forgot that in [a-z0-9][_\-][a-z0-9] the character on the right is
> already matched, so it won't work as a start for the second _ in _a_....
You know, I thought that was the problem initially, but then remembered
that the regular expression engine does backtracking in order to
maximise any match. When it encounters the underscore after assigning
the letter to the first subpattern, it's supposed to abandon the
previous match, backtrack to the letter, and go down the second branch.
[Back to original message]
|