anand_perl has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: matching non-word character in perl
by moritz (Cardinal) on Oct 06, 2008 at 15:03 UTC
    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).

Re: matching non-word character in perl
by Anonymous Monk on Oct 06, 2008 at 19:26 UTC