> > I want to use django to dispatch url.
> > The url is like /test/Google/6,and my patten is r'^/test/(?P\b\W+
\W should be \w, a typo? :)
> > \b)/(?P\d+)$'.
> > It works when the string is English(like Google), but fails when the
> > string is in foreign language.
Try this:
r'(?u)^/test/(?P\b\w+\
lookon a écrit :
I want to use django to dispatch url.
The url is like /test/Google/6,and my patten is r'^/test/(?P\b\W+
\b)/(?P\d+)$'.
It works when the string is English(like Google), but fails when the
string is in foreign language.
Care to give an exemple of url that fails ?
Anyway, if you
>
>
>
>
> -- Forwarded message --
> From: lookon <[EMAIL PROTECTED]>
> To: python-list@python.org
> Date: Fri, 10 Oct 2008 03:58:08 -0700 (PDT)
> Subject: a regular expression problem
> I want to use django to dispatch url.
> The url is like /
I want to use django to dispatch url.
The url is like /test/Google/6,and my patten is r'^/test/(?P\b\W+
\b)/(?P\d+)$'.
It works when the string is English(like Google), but fails when the
string is in foreign language.
Can anyone tell me the righ regular expression?
Thank you!
--
http://mail.pyth