Monday, May 23, 2011

Parenthesis in regex in URLConf

Hello,
I have a regular expression for usernames and I want to use this regex
in my URLConf and bind that to a view. The problem is, I have
parenthesis in my regex which should not consider as *args*. Here's my
regex:

^[a-zA-Z0-9]+((\.[a-zA-Z0-9]+)|(_[a-zA-Z-0-9]+))*$

Values in '()' are necessary in my regex but I don't want to pass
these values to my view.
What should I do?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment