my $tag = q{<test-result value="FAIL"/>}; if ($str =~ m/\Q$tag\E/) { print "«$str» contains «$tag»\n"; }
If this is not what you want, please elaborate. Also don't use regexes to match XML, use a module for parsing instead (perhaps XML::LibXML or XML::Twig).
In reply to Re: matching non-word character in perl
by moritz
in thread matching non-word character in perl
by anand_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |