88k regex = RuntimeError

Kent Johnson kent at kentsjohnson.com
Tue Feb 14 06:07:17 EST 2006


jodawi wrote:
> I need to find a bunch of C function declarations by searching
> thousands of source or html files for thousands of known function
> names. My initial simple approach was to do this:
> 
> rxAllSupported = re.compile(r"\b(" + "|".join(gAllSupported) + r")\b")
> # giving a regex of   \b(AAFoo|ABFoo|   (uh... 88kb more...)   |zFoo)\b

Maybe you can be more clever about the regex? If the names above are 
representative then something like r'\b(\w{1,2})Foo\b' might work.



More information about the Python-list mailing list