in reply to regex negative lookahead behaviour
The problem is that whilst \s* is greedy, it will also match zero spaces, which means that '1/2' followed by zero spaces is not followed by 'MILE', because it is followed by ' MILE' which satisfies the condition, so the expression is true.
The only thing that overrides a regexes natural greediness is it's desire to achieve a match. If it can, it will, and it can, so it does:)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: regex negative lookahead behaviour
by pijll (Beadle) on Jul 19, 2003 at 11:49 UTC |