in reply to Re^3: Match zero times in regex
in thread Match zero times in regex

I don't see how an IP (10.11.1.1 in the example) after 'host' is ever desired to be captured.

Exactly, yet I showed that your code does capture it.

Replies are listed 'Best First'.
Re^5: Match zero times in regex
by AnomalousMonk (Archbishop) on Dec 17, 2011 at 21:13 UTC
    Am I missing something ...?

    I went back and tried the exact strings of your counter-example (at first, I thought you were (mis-)quoting something, but couldn't figure out what it was) and I finally see your point: if there are two or more whitespaces between 'host' and the immediately following IP, then that IP will not be excluded because there is a position in the string that is followed by one or more whitespaces and is preceded by something that is not 'host', i.e., by one or more whitespaces.

    OK, got it at last!