Turning your code into one statement is such a weird requirement, but it's easy to do
my $fixed = $ptext =~ s/^\"//r =~ s/\"$//r =~ s/^\'//r =~ s/\'$//r =~ s/\'/\\\'/gr =~ s/\"/\\\"/gr =~ s/\{/\\\{/gr;
It's not how I'd do it, though.
In reply to Re: Regexp and metacharacters
by ikegami
in thread Regexp and metacharacters
by Largins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |