Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #12555
| Date | 2011-09-01 12:42 +0300 |
|---|---|
| Subject | Regex to match all trailing whitespace _and_ newlines. |
| From | Dotan Cohen <dotancohen@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.653.1314870127.27778.python-list@python.org> (permalink) |
In the terrific Anki [1] application I am trying to remove trailing whitespace from form fields. This is my regex: [\n+\s+]$ 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. Thanks. [1] ankisrs.net -- Dotan Cohen http://gibberish.co.il http://what-is-what.com
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Regex to match all trailing whitespace _and_ newlines. Dotan Cohen <dotancohen@gmail.com> - 2011-09-01 12:42 +0300
Re: Regex to match all trailing whitespace _and_ newlines. Peter Otten <__peter__@web.de> - 2011-09-01 12:30 +0200
Re: Regex to match all trailing whitespace _and_ newlines. Dotan Cohen <dotancohen@gmail.com> - 2011-10-11 00:23 +0200
csiph-web