Regular expressions vs find?
David C. Ullrich
ullrich at math.okstate.edu
Mon Jun 19 11:37:55 EDT 2000
Eric Hagemann <ehagemann at home.com> wrote in article
<LOc35.5656$_54.105800 at news1.rdc1.md.home.com>...
> [snip]
> Also you might have better luck with the regular expression stuff (rather
> than the find command) and precompiling the string
> [snip]
>
> I think I am the somebody who said this ;)
yeah, I wasn't sure whether it was appropriate to include your
name or not...
> My mind was racing faster than my fingers.
Um, ???
> The re stuff _is_ slower than
> find. I have measured the slowdown to be a factor of 2 or 3. As also
proven
> below.
>
> My real thoughts were that most grep's (or findstr in NT) do more than
> simple string matching and thus the re module might be desired or a
better
> comparison. If all that is desired is simple matching however, then
> string.find is your way to go.
Right. In fact this is more or less what I took your post to mean
at first glance - had to read it carefully to find what Bill had said you
said.
DU
> Cheers
> Eric
More information about the Python-list
mailing list