regular expression negate a word (not character)

Greg Bacon gbacon at hiwaay.net
Tue Jan 29 12:12:09 EST 2008


In article <fnlfr0.1fk.1 at news.isolution.nl>,
    Dr.Ruud <rvtol+news at isolution.nl> 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 looking for matches.

I dunno. Maybe it was the familiar compulsion with Perl to
attempt to cram everything into a single pattern.

Greg
-- 
What light is to the eyes -- what air is to the lungs -- what love is to
the heart, liberty is to the soul of man. 
    -- Robert Green Ingersoll



More information about the Python-list mailing list