a regular expression problem

gita ziabari gitaziabari at gmail.com
Fri Oct 10 14:31:40 CEST 2008


>
>
>
>
> ---------- Forwarded message ----------
> From: lookon <areyoulookon at gmail.com>
> To: python-list at 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 /test/Google/6,and my patten is r'^/test/(?P<q>\b\W+
> \b)/(?P<h>\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!
>
>
>
> Add:  # -*- coding: utf-8 -*- at the beginning of your script and try
again. This is for handling non-ascii characters.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20081010/766ba5bd/attachment.html>


More information about the Python-list mailing list