Opened 7 years ago
Last modified 3 years ago
#28628 closed Cleanup/optimization
Audit for and abolish all use of '\d' in regexes — at Version 2
Reported by: | James Bennett | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Ad Timmering, security@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Now that we're in the 2.0 release cycle and Python 3 only, any examples or code in Django using a \d
in a regex should be replaced with [0-9]
, as \d
on Python 3 matches any character with Unicode category [Nd], which is almost certainly not what people expect. Changing to explicit [0-9]
, perhaps with a note about why it should be preferred, would be better.
Change History (2)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
Description: | modified (diff) |
---|---|
Summary: | Audit for and abolish all use of '\d' in URL patterns → Audit for and abolish all use of '\d' in regexes |
Note:
See TracTickets
for help on using tickets.
Here's a tentative list of places that should change, from grepping on current master: