In my django application I have my URLS.PY configured to accept requests to /community/user/id and /community/user/id/ with:
url(r'^(?P<username>[\w-]+)/(?P<cardId>\d+)/$', 'singleCard.views.singleCard', name='singleCardView'),
I did this as some times people will add an ending "/" and I didn't want to raise a 404.
However parts of my javascript application sometime add a anchor tag in the form of:
/community/user/id#anchorIuseInJavscriptToDoSomething
The problem I have is Django will instantly rewrite the URL to:
/community/user/id/
with an ending / and remove the #anchorIuseInJavscriptToDoSomething
Id like it to rewrite it to:
/community/user/id#anchorIuseInJavscriptToDoSomething/
This way my javascript in the page can still see the anchor and work. How can adapt this regex to do this? I'm not very good at regex, and learnt this one by example...