On Mon, Jan 11, 2010 at 12:02 PM, Jeremy <jlcon...@gmail.com> wrote: > Your guess is correct. I had forgotten that I was using that > function. > > I am using the re.sub command to remove trailing whitespace from lines > in a text file. The commands I use are copied below. If you have any > suggestions on how they could be improved, I would love to know. > > Just use line.rstrip().. Regular expressions are almost always slower then just calling string methods for simple operations.
HTH, --S
-- http://mail.python.org/mailman/listinfo/python-list