in reply to regex negative lookahead behaviour

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:)
How about putting a +after the quantifier?

Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality

Replies are listed 'Best First'.
Re: Re: regex negative lookahead behaviour
by sauoq (Abbot) on Jul 18, 2003 at 18:59 UTC
    How about putting a +after the quantifier?

    Then it breaks as soon as someone typos an extra space into the address. So, you can only do that if you can assume spaces have been normalized and there will be only one... But, if you can make that assumption, then there'd be no reason for a quantifier at all. :-)

    -sauoq
    "My two cents aren't worth a dime.";