Syntactic Confectionery Delight | |
PerlMonks |
Re: Is there any way to put regex modifiers into a variable?by Anonymous Monk |
on Mar 12, 2018 at 14:13 UTC ( [id://1210725]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|