Is there an easy way to add regex modifiers such as 'i' to a quoted regular expression? For example:
$pat = qr/F(o+)B(a+)r/;
$newpat = $pat . 'i'; # This doesn't work
The only way I can think of is to print "$pat\n"
and get back (?-xism:F(o+)B(a+)r)
and try to remove the 'i' in ?-xism:
with a substitution
(?…)
part is documented in perldoc.perl.org/perlre.html#Extended-Patterns – Sse