re module - cannot make expression

Steve Holden steve at holdenweb.com
Mon Jan 31 09:51:14 EST 2005


Laszlo Zsolt Nagy wrote:

> Hi All!
> 
> I would like to match strings not beginning with '/webalizer'. How can I 
> do this?
> The only one negation command is ^ inside [] but it cannot be used here. 
> I looked
> over "re" examples on the net but I could not find an example about how 
> to match
> "not beginning with" type expressions.
> 
> Thanks,
> 
>   Laci 2.0
> 
You can do taht with Python re's. Look in the re documentation for 
"negative lookahead assertion".

regards
  Steve
-- 
Steve Holden               http://www.holdenweb.com/
Python Web Programming  http://pydish.holdenweb.com/
Holden Web LLC      +1 703 861 4237  +1 800 494 3119



More information about the Python-list mailing list