Syntactic Confectionery Delight | |
PerlMonks |
Re: Executing a "/foo/flags" regex from a string (qr flags)by Anonymous Monk |
on Dec 30, 2015 at 01:52 UTC ( [id://1151416]=note: print w/replies, xml ) | Need Help?? |
qr can do it as perlre syntax allows (?i) the same as /i
App::Ack uses this trick You can use eval { no re qw/eval/; qr/$regex/ }; to see if the regex compiles See also Text::Glob#glob_to_regex
In Section
Seekers of Perl Wisdom
|
|