regular expressions questions

David Fisher python at
Sat Apr 1 00:09:24 EST 2000

Well, that'll teach me to jump into a thread without reading the previous
posts. ;) In context I get it now.  And it's nice to have my prejudices on
the subject confirmed.

----- Original Message -----
From: "Tom Culliton" <culliton at>
Newsgroups: comp.lang.python
To: <python-list at>
Sent: Friday, March 31, 2000 3:15 PM
Subject: Re: regular expressions questions

> In article <010001bf9acf$500cff00$d4c2043f at spkydomain>,
> David Fisher <python at> wrote:
> > This statement suprised me.  I had gotten the impression from
> > lurking in the newsgroup that the functions in the string module
> > were as fast or faster for many operations.
> You misunderstood the statement.  The string module is mainly a front
> for the strop module written in C which is faster for the cases where
> you can use it.
> >Is re really that much faster that string?
> No, of course not, unless it lets you do something in one go that
> would take you many string operations and connecting logic in python.
> Doing string.find will generally be faster than doing for
> simple strings, because is a more complex operation.  On the
> other hand doing a complex re.sub will be faster than emulating it
> with several string operations.

More information about the Python-list mailing list