in reply to Regexp and metacharacters
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regexp and metacharacters
by Largins (Acolyte) on Dec 27, 2011 at 03:32 UTC | |
by ikegami (Patriarch) on Dec 27, 2011 at 06:28 UTC |