in reply to Re: Regexp and metacharactersin thread Regexp and metacharacters
Ok, so how would you do it?
I would go for readability instead.
my $fixed = $ptext; $fixed =~ s/^['"]//; $fixed =~ s/['"]\z//; $fixed = quotemeta($fixed); [download]
That's probably useless since your list of meta characters differs from quotemeta's. If so, then you can use:
my $fixed = $ptext; $fixed =~ s/^['"]//; $fixed =~ s/['"]\z//; $fixed =~ s/([\\'"...])/\\$1/g; [download]