in reply to Re^2: Regex AND NOT with zero-width negative lookahead assertion
in thread Regex AND NOT with zero-width negative lookahead assertion

How odd. It works fine exactly as posted for me in Perl 5.20.3. Which Perl version are you using which requires the escape?

Update: also tested successfully on v5.10.1, v5.16.3, v5.26.1 and v5.30.0.

  • Comment on Re^3: Regex AND NOT with zero-width negative lookahead assertion

Replies are listed 'Best First'.
Re^4: Regex AND NOT with zero-width negative lookahead assertion
by Your Mother (Archbishop) on Mar 25, 2020 at 14:04 UTC

    I believe this works everywhere; certainly does on 5.8. What *doesn’t* work a lot of the time is syntax highlighting and autoformatting. I end up escaping them sometimes just so I don’t have to deal with that; in certain codebases/c?perl-modes at least.

Re^4: Regex AND NOT with zero-width negative lookahead assertion
by AnomalousMonk (Archbishop) on Mar 26, 2020 at 03:41 UTC

    The  m, ... ,x match in the OPed code uses the  /x whitespace/comments modifier; your match does not. (Update: I presume mldvx4 is still using the  /x modifier.)


    Give a man a fish:  <%-{-{-{-<