in reply to pos CONFUSION in REGEX
Then the regex engine tries again starting from point 1, and matches again. Since it matched with zero width twice in a row, the regex engine fears an infinite recursion and artificially bumps the position.
Most patterns don't have side effects, so usually you don't observe this behaviour - but it's the reason why split // works (unless that case is special-cased).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: pos CONFUSION in REGEX
by suhailck (Friar) on Dec 14, 2009 at 16:47 UTC |