re.search much slower then grep on some regular expressions

Paddy paddy3118 at googlemail.com
Sat Jul 5 09:31:24 CEST 2008


On Jul 5, 7:01 am, Peter Otten <__pete... at web.de> wrote:
> Paddy wrote:
> > It is not a smarter algorithm that is used in grep. Python RE's have
> > more capabilities than grep RE's which need a slower, more complex
> > algorithm.
>
> So you're saying the Python algo is alternatively gifted...
>
> Peter

The following isn't the article I read on regexp types and their speed
differences but it does give info on regexp engine types:
http://books.google.co.uk/books?id=GX3w_18-JegC&pg=PA145&lpg=PA145&dq=%2Bregex+%2Bspeed+%2Bgrep+%2Btcl+&source=web&ots=PHljNqeuJZ&sig=CyBCOZYsyZaJTMfj2Br53if46Bc&hl=en&sa=X&oi=book_result&resnum=3&ct=result#PPA145,M1

- Paddy.



More information about the Python-list mailing list