You want modifiers inside the regex:
my $modifiers = 'i'; my $text = 'abc'; my $pattern = 'BC'; if ( $text =~ m/(?$modifiers:$pattern)/) { print "it matches\n"; }
Only good for turning on (or off) options imsx. See perlre.
print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!
In reply to Re: Regular expression modifiers in a scalar
by Sidhekin
in thread Regular expression modifiers in a scalar
by wintermte
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |