Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 perusing the Monastery: (4)
As of 2018-07-23 10:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (462 votes). Check out past polls.

    Notices?