in reply to Re: Match something that does not match
in thread Match something that does not match

Your regex is indeed the one I was after. Though it works, I still don't get it :-(
And I agree with you: this is too simple for Regexp::Common

Thanks for your comment. Still learning...

-jo

  • Comment on Re^2: Match something that does not match

Replies are listed 'Best First'.
Re^3: Match something that does not match
by haukex (Archbishop) on Feb 15, 2020 at 21:41 UTC
    Though it works, I still don't get it :-(

    The . matches anything (except newline), and (?!$pat) means "the next thing can't be $pat", so taken all together it really just means "match any number of characters, where none of these characters may be the first character of $pat".

      I was challenged by the mental step of putting something after a look-ahead assertion. Failing to understand this lead to the missing last character in the second branch of my original regex.
      Anyway, the fog lifts. Thanks a lot!

      -jo