Regex to match all trailing whitespace _and_ newlines.

Dotan Cohen dotancohen at
Thu Sep 1 11:42:04 CEST 2011

In the terrific Anki [1] application I am trying to remove trailing
whitespace from form fields. This is my regex:

Actually, even simplifying it to [\n] or [\r\n] is not matching any
newlines! What might be the cause of this? Note that I am not entering
the regex in Python code, I am entering it in a regex-supporting
Find/Replace dialogue in Anki. Anki is written in Python.



Dotan Cohen

More information about the Python-list mailing list