Update: just acknowledging the fact that (as has been pointed out) this solution doesn't actually work. I won't bother changing the code, but rather leave it there as an example of how _not_ to do it ;)
Prints:#!/usr/bin/perl -wl use strict; while (<DATA>) { chomp; print "$_ matched" if /^[^(?:cat)]/; } __DATA__ cat dog dog cat frog cat dog mouse dog cat cat dog elephant
Cheers,dog cat matched frog cat dog matched mouse dog cat matched
In reply to Re: Regex negative word
by McDarren
in thread Regex negative word
by zer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |