10
I was taking a look at Django’s code, framework in Python, and I came across the following code in the file urls.py
.
urlpatterns = [
url(r'^articles/2003/$', views.special_case_2003),
url(r'^articles/([0-9]{4})/$', views.year_archive),
url(r'^articles/([0-9]{4})/([0-9]{2})/$', views.month_archive),
url(r'^articles/([0-9]{4})/([0-9]{2})/([0-9]+)/$', views.article_detail),
]
I didn’t really understand what that passage would be
r'^articles/2003'
What is this r
preceding the declaration of string?
It is something related to regular expressions?
Honestly, I do not know what the problem has the question and why received -1
– gmsantos
I don’t care, @gmsantos. Let it go. Long live Stackoverflow!
– Wallace Maxters