in reply to Can I make Perl ignore a special char when matching?
Why not create a copy of the string with the special char removed and use that for the initial matching?
Alternatively you could:
use strict; use warnings; my $matchStr = 'aabb'; my $match = "\xff?" . join ("\xff?", split '', $matchStr) . "\xff?"; my $str = "aa\xffbb"; if ($str =~ $match) { print "Matched"; } else { print "No match"; }
|
|---|