[Tutor] Checking for Control Characters
alan.gauld@bt.com
alan.gauld@bt.com
Mon, 8 Apr 2002 16:06:35 +0100
Dman sayeth:
> > I recommend using a regex instead of a linear search.
> > It will likely be faster,
Shiela replies:
> In Python, regex is not as fast as in Perl (I believe).
This is irrelevant surely?
The question is whether Python re.search is faster than
Python string.find or the 'in' operation. Dman suggests
it is, I don't know. But comparisons with Perl are
spurious surely?
(FWIW They aren't much slower than Perl IME they just
require a module import before use wheras Perl regex is
builtin... - the old regex module of course is a different
matter!)
Alan g.