Time-out for regular expressions...

samslists at gmail.com samslists at gmail.com
Sat Jun 21 00:44:56 CEST 2008

I'm doing a lot of regular expressions these days.  Sometimes when I'm
crafting them I mess up, and make them too complicated.  So that when
my program runs, they take forever.  (Maybe not literally forever---I
abort the program after a few seconds.)

What I'd like to have happen is every time I search using a regular
expression is after a few seconds (the exact number being user
definable), it will stop searching, perhaps by raising an exception.

How can I implement this?


More information about the Python-list mailing list