[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: Large regular expressions

Stefan Behnel

3/15/2010 12:46:00 PM

Nathan Harmston, 15.03.2010 13:21:
> So I m trying to use a very large regular expression, basically I have
> a list of items I want to find in text, its kind of a conjunction of
> two regular expressions and a big list......not pretty. However
> everytime I try to run my code I get this exception:
>
> OverflowError: regular expression code size limit exceeded
>
> I understand that there is a Python imposed limit on the size of the
> regular expression. And although its not nice I have a machine with
> 12Gb of RAM just waiting to be used, is there anyway I can alter
> Python to allow big regular expressions?
>
> Could anyone suggest other methods of these kind of string matching in
> Python?

If what you are trying to match is in fact a set of strings instead of a
set of regular expressions, you might find this useful:

http://pypi.python.org/...

Stefan