Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Regexp substitution using variables

by LanX (Saint)
on Nov 25, 2020 at 23:30 UTC ( [id://11124240]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Regexp substitution using variables
in thread Regexp substitution using variables

> does not (at least to my eyes) show what the difference is between them.

you are comparing

in your example there is no difference, but in the second approach with pattern the reach of modifiers is limited to the group.

DB<24> p 'xX' =~ /(?i:X)X/ 1 DB<25> p 'xX' =~ /(?i:X)x/ DB<26> p 'xX' =~ /(?i)Xx/ 1 DB<27>

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11124240]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-28 21:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found