in reply to Disable Regex
I've been trying all sorts of ideas to supress the \\ being escaped, but I'm stuck.
my $test = <<'TEXT'; illegal\\characters\*example? TEXT my @illegal = qw( \ * ? ); my @legal = qw( bs a q ); my $c = 0; for my $val ( @illegal ) { $test =~ s/\Q$val\E/[$legal[$c]]/g; $c++; } print "$test\n";
This produces:
illegal[bs][bs]characters[bs][a]example[q]
|
|---|