Message141430
+_find_unsafe = re.compile(r'[^\w\d@%_\-\+=:,\./]').search
\w already includes both \d and _, so (unless you really want to be explicit about it) they are redundant. Also keep in mind that they match non-ASCII letters/numbers on Python 3.
'+' and '.' don't need to be escaped in a character class (i.e. [...]), because they lose their meta-characters meaning there.
'-' is correctly escaped there, but it's common practice to place it at the end of the character class, where it doesn't need escaping.
r'[^\w\d@%_\-\+=:,\./]' and r'[^\w@%+=:,./-]' should therefore be equivalent. |
|
Date |
User |
Action |
Args |
2011-07-30 07:20:17 | ezio.melotti | set | recipients:
+ ezio.melotti, georg.brandl, vstinner, eric.smith, eric.araujo, r.david.murray, brandon-rhodes, anacrolix, xuanji, python-dev |
2011-07-30 07:20:17 | ezio.melotti | set | messageid: <1312010417.59.0.384316359522.issue9723@psf.upfronthosting.co.za> |
2011-07-30 07:20:17 | ezio.melotti | link | issue9723 messages |
2011-07-30 07:20:16 | ezio.melotti | create | |
|