I’m trying to match a Django URL bit that can contain:
_, %, &, +, 0-9, a-z, A-Z, (space)
How can I do it so it is picked up by Django’s URL matcher, in form of a parameter?
(r'^(?P<chararg>\w+)/IT_NEEDS_TO_BE_HERE/(?P<intarg>\d+)', 'dest')
I played a bit and got this –
[\w\+%_& ]+.So
(r'^(?P<chararg>\w+)/IT_NEEDS_TO_BE_HERE/(?P<intarg>\d+)', 'dest')would become\wmatches any word characters and digits.\+mathces +EDIT: \d is not necessary.