Code below
use strict; use warnings; my $sentence = 'The quick brown fox jumped over the lazy dog'; print "$sentence \n"; my $substring = 'The quick.!*?fox'; print "$substring \n"; my $quoted_substring = quotemeta($substring); print "$quoted_substring \n"; $sentence =~ s/quick brown/$quoted_substring/; print "$sentence \n";
In reply to Re: Escaping special characters
by crusty_collins
in thread Escaping special characters
by tiny_monk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |