L
LtCommander
This could be a stupid question but I am really stuck!
I am doing
$content=~ s/$m//sig;
The problem is that $m may have all sorts of escape sequence
characters, brackets and so on. So, sometimes, $content doesn't have
$match removed. So, I do this:
$m =~ s/\(/\\(/sig;
$m =~ s/\)/\\)/sig;
$m =~ s/\[/\\[/sig;
$m =~ s/\]/\\]/sig;
$m =~ s/\?/\\?/sig;
$m =~ s/\*/\\*/sig;
$m =~ s/\./\\./sig;
$m =~ s/\$/\\\$/sig;
$m =~ s/\+/\\+/sig;
$m =~ s/\_/\\_/sig;
$m =~ s/\-/\\-/sig;
and then
$content=~ s/$m//sig;
Is there a better way of doing this?
Thanks a lot for any help.
VInce
I am doing
$content=~ s/$m//sig;
The problem is that $m may have all sorts of escape sequence
characters, brackets and so on. So, sometimes, $content doesn't have
$match removed. So, I do this:
$m =~ s/\(/\\(/sig;
$m =~ s/\)/\\)/sig;
$m =~ s/\[/\\[/sig;
$m =~ s/\]/\\]/sig;
$m =~ s/\?/\\?/sig;
$m =~ s/\*/\\*/sig;
$m =~ s/\./\\./sig;
$m =~ s/\$/\\\$/sig;
$m =~ s/\+/\\+/sig;
$m =~ s/\_/\\_/sig;
$m =~ s/\-/\\-/sig;
and then
$content=~ s/$m//sig;
Is there a better way of doing this?
Thanks a lot for any help.
VInce