in reply to Using 'ord' in a regular expression for substitution
my $char = chr(226); my $pat = quotemeta($char); # Create pattern that matches string s/$pat/'/ig;
my $char = chr(226); s/\Q$char\E/'/ig; # Alternate way of calling quotemeta
s/\xE2/'/ig; # 0xE2 == 226
|
|---|