Find and Replace Simplification

Serhiy Storchaka storchaka at gmail.com
Fri Jul 19 19:29:20 CEST 2013


19.07.13 19:22, Steven D'Aprano написав(ла):
> I also expect that the string replace() method will be second fastest,
> and re.sub will be the slowest, by a very long way.

The string replace() method is fastest (at least in Python 3.3+). See 
implementation of html.escape() etc.





More information about the Python-list mailing list