in reply to Re: Matching backslash in regexp negative lookbehind
in thread Matching backslash in regexp negative lookbehind

[ ' " ]           # either kind of quote

Note that  [ ' " ] also matches a blank (0x20). Better perhaps to use  ['"] instead.


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

Replies are listed 'Best First'.
Re^3: Matching backslash in regexp negative lookbehind
by soonix (Chancellor) on Jan 02, 2018 at 21:55 UTC
    Yes. But there's another possibility: - quoting Regexp Quote-Like Operators in perlop:
    x   Use extended regular expressions;
    specifying two x's means \t and the SPACE character are ignored within square-bracketed character classes

      Forgot about that. I'm not really up on the latest regex extensions. Offhand, do you know with what Perl version the  xx modifier modification was added?


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

        > with what Perl version

        5.26

        ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
        I hadn't known about it either, I simply looked it up to see wether the doc contained a warning about that, and found this.

        Thanks choroba for the good idea (and moreso for implementing it)!