On Mon, Jan 11, 2010 at 12:02 PM, Jeremy <span dir="ltr"><<a href="mailto:jlconlin@gmail.com">jlconlin@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div><div></div><div class="h5">Your guess is correct.  I had forgotten that I was using that</div></div>
function.<br>
<br>
I am using the re.sub command to remove trailing whitespace from lines<br>
in a text file.  The commands I use are copied below.  If you have any<br>
suggestions on how they could be improved, I would love to know.<br>
<br></blockquote><div><br></div><div>Just use line.rstrip().. Regular expressions are almost always slower then just calling string methods for simple operations.</div><div><br></div><div>HTH,</div><div>--S</div><div> </div>

</div>