regular expressions questions
python at rose164.wuh.wustl.edu
Sat Apr 1 07:09:24 CEST 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 clark.net>
To: <python-list at python.org>
Sent: Friday, March 31, 2000 3:15 PM
Subject: Re: regular expressions questions
> In article <010001bf9acf$500cff00$d4c2043f at spkydomain>,
> David Fisher <python at rose164.wuh.wustl.edu> 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 re.search for
> simple strings, because re.search 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