M
Mohammed Ishaq
I have a been trying to do a string match, and the string has []
characters. I do not want perl to treat this a regular expression, but
I cannot get it match. I have the following perl snippet, and the
output of these two searches is different, but I think that both
searches should match successfully.
thanks for any light you can throw.
mi
#!/usr/bin/perl -w
my $e="abcde[12]";
my $f="XYZ[12] abcde[12] XYZ[12]";
if ( $f =~ /\b\Q$e\E/ ) { print "match\n"; } else { print "no match\n"
}
if ( $f =~ /\b\Q$e\E\b/ ) { print "match\n"; } else { print "no
match\n" }
characters. I do not want perl to treat this a regular expression, but
I cannot get it match. I have the following perl snippet, and the
output of these two searches is different, but I think that both
searches should match successfully.
thanks for any light you can throw.
mi
#!/usr/bin/perl -w
my $e="abcde[12]";
my $f="XYZ[12] abcde[12] XYZ[12]";
if ( $f =~ /\b\Q$e\E/ ) { print "match\n"; } else { print "no match\n"
}
if ( $f =~ /\b\Q$e\E\b/ ) { print "match\n"; } else { print "no
match\n" }