mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #28628 -- Changed \d to [0-9] in regexes where appropriate.
This commit is contained in:
parent
fe76944269
commit
bdf3e156b4
10 changed files with 35 additions and 17 deletions
|
@ -246,8 +246,8 @@ following URL patterns which optionally take a page argument::
|
|||
from django.urls import re_path
|
||||
|
||||
urlpatterns = [
|
||||
re_path(r'^blog/(page-(\d+)/)?$', blog_articles), # bad
|
||||
re_path(r'^comments/(?:page-(?P<page_number>\d+)/)?$', comments), # good
|
||||
re_path(r'^blog/(page-([0-9]+)/)?$', blog_articles), # bad
|
||||
re_path(r'^comments/(?:page-(?P<page_number>[0-9]+)/)?$', comments), # good
|
||||
]
|
||||
|
||||
Both patterns use nested arguments and will resolve: for example,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue