- or download this
print($regexp) Expect Gives
-------------- ------------ ----------
...
\Q**LOL** \*\*LOL\*\* \Q**LOL**
\\Quit\\Exit \\Quit\\Exit \Quit\Exit
\Qfoo\\E foo\\\\E foo\\
- or download this
my $in_quote = 0;
...
}
}
/eg;
- or download this
$regexp =~ s/
\G
...
/
$1 . (defined($2) ? quotemeta($2) : '')
/xge;