in reply to When greedy constructs do battle, can I choose the winner?
Principle 3: If there are two or more elements in a regexp, the leftmost greedy quantifier, if any, will match as much of the string as possible while still allowing the whole regexp to match. The next leftmost greedy quantifier, if any, will try to match as much of the string remaining available to it as possible, while still allowing the whole regexp to match. And so on, until all the regexp elements are satisfied.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: When greedy constructs do battle, can I choose the winner?
by amarquis (Curate) on Sep 20, 2007 at 18:54 UTC | |
by duff (Parson) on Sep 21, 2007 at 02:22 UTC |