in reply to Regex: Lookahead

want my regex to "find any instance of a url not followed by a quote or a carrot"
Oh, but it does. Except that you failed to realize that http://www.google.co is also a URL not followed by a quote or a carrot.

And you don't need the bar inside a character class. Unless you want to match a bar as well.

Replies are listed 'Best First'.
Re^2: Regex: Lookahead
by Rodster001 (Pilgrim) on May 12, 2009 at 15:33 UTC
    What did I fail to realize? The first line does not have a carrot or a quote, so I want it to match there. The second line does have a quote following it, so I want it to fail on that one (do nothing).

      The second line does have a quote following it,

      "it"? There are many urls in the second line. Yes, one of them is followed by a quote. But you asked to find one that isn't followed by a quote, and perl found one. "http://www.google.co" is followed by a "m", not a quote.