Regular Expression question

looping kadeko at
Thu Oct 25 09:54:07 CEST 2007

On Oct 25, 9:25 am, Peter Otten <__pete... at> wrote:
> You want a "negative lookahead assertion" then:

Now I feel dumb...
I've seen the (?!...) dozen times in the doc but never figure out that
it is what I'm looking for.

So this one is the winner:
s ='create\s+or\s+replace\s+package\s+(?!body\s+)', txt,

Thanks Peter and Marc.

More information about the Python-list mailing list