Of course it is better to precompile the expression, but I guess replace will beat even a precompiled regular expression. You could see this posting: http://groups.google.nl/group/comp.lang.python/msg/32af24eab9024f60?&hl=nl&q=replace+re+speed+python+sub
But performance should be measured, not guessed. Stani -- SPE - Stani's Python Editor http://pythonide.stani.be http://pythonide.stani.be/manual/html/manual.html -- http://mail.python.org/mailman/listinfo/python-list