With a negative look ahead assertion:
$_ = "cat dog"; print 'match' if /^(?!cat)/; print 'no match' unless /^(?!cat)/;
Prints:
no match
In reply to Re: Regex negative word
by GrandFather
in thread Regex negative word
by zer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |