Re: regular expression negate a word (not character)

2008-01-29 Thread Greg Bacon
In article <[EMAIL PROTECTED]>, Dr.Ruud <[EMAIL PROTECTED]> wrote: : I negated the test, to make the regex simpler: [...] Yes, your approach is simpler. I assumed from the "need it all in one pattern" constraint that the OP is feeding the regular expression to some other program that is looki

Re: regular expression negate a word (not character)

2008-01-28 Thread Greg Bacon
The code below at least passes your tests. Hope it helps, Greg #! /usr/bin/perl use warnings; use strict; use constant { MATCH=> 1, NO_MATCH => 0, }; my @tests = ( [ "winter tire",=> MATCH ], [ "tire", => MATCH ], [ "retire",