in reply to regular expression inverse match NOT match?
There are two ways to do this. The first is to use an ordinary match and then negate the result:
if (!($string =~ /keyword/)) { print "match failed"; }
or:
unless ($string =~ /keyword/) { print "match failed"; }
The second is to use the negated binding operator !~:
if ($string !~ /keyword/) { print "match failed"; }
Hope that helps,
Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
---|
In Section
Seekers of Perl Wisdom