Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Matching backslash in regexp negative lookbehind

by AnomalousMonk (Chancellor)
on Jan 02, 2018 at 20:03 UTC ( #1206557=note: print w/replies, xml ) Need Help??


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 (Monsignor) 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)!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1206557]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2018-06-20 20:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (117 votes). Check out past polls.

    Notices?