doing hundreds of re.subs efficiently on large strings

Alex Martelli aleax at aleax.it
Thu Mar 27 19:25:08 CET 2003


Anders J. Munch wrote:

> "Alex Martelli" <aleax at aleax.it> wrote:
>> It's simpler/cleaner, and yes, that's more an issue of aesthetics than
>> of measurements.  Not sure what you mean by the .sub method "escaping
>> your attention" when it's right in the subject
> 
> Reading help(re.sub), I took the 'repl' parameter for a simple string
> parameter and missed the dual typing.

Ah, yes -- that help text is definitely remiss in not mentioning the
sub method's special powers and pointing to the docs about it!


Alex





More information about the Python-list mailing list