#28628: Audit for and abolish all use of '\d' in regexes
-------------------------------------+-------------------------------------
Reporter: James Bennett | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by James Bennett:
Old description:
> 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 URL pattern 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.
New description:
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.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/28628#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/069.218508f7c57029d66247186df3c9ec40%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.