Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Is there any way to put regex modifiers into a variable?

by Anonymous Monk
on Mar 12, 2018 at 14:13 UTC ( #1210725=note: print w/replies, xml ) Need Help??


in reply to Is there any way to put regex modifiers into a variable?

You can compile an arbitrary string into a variable which contains a regular-expression. The value of this variable can be subsequently used to match things. See qr// under perldoc perlop ("Regexp Quote-Like Operators"). **EDIT** "qr" not "qx!" Oops.
  • Comment on Re: Is there any way to put regex modifiers into a variable?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2018-04-20 22:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?