Python论坛  - 讨论区

标题:[python-chinese] django的urls 匹配问题,能否匹配所有的大小写?

2007年12月01日 星期六 10:32

1234 mydjango在gmail.com
星期六 十二月 1 10:32:58 HKT 2007

ºÇºÇ »¹ÊÇ limodou À÷º¦ hoho~~~

(r'^(?i)bbs/', include('wedding.apps.bbs.urls')),

ÕâÑù¾Í½â¾öÁË ¹þ¹þ  лл¸÷λ


ÔÚ07-11-30£¬@@ <askfor在gmail.com> дµÀ£º
>
> *(?iLmsux)* (One or more letters from the set "i", "L", "m", "s", " u", "x".)
> The group matches the empty string; the letters set the corresponding flags
> (re.I, re.L, re.M , re.S, re.U, re.X) for the entire regular expression.
> This is useful if you wish to include the flags as part of the regular
> expression, instead of passing a flag argument to the compile() function.
>
> Note that the (?x) flag changes how the expression is parsed. It should be
> used first in the expression string, or after one or more whitespace
> characters. If there are non-whitespace characters before the flag, the
> results are undefined.
>
>
> º¹¡£·¢ÌùǰÕÒÁËÏÂÎĵµµÄ£¬½á¹û¿´µÃ²»¹»×Ðϸ¡£
>
>
> On 11/30/07, limodou <limodou在gmail.com> wrote:
> >
> > On Nov 30, 2007 4:41 PM, @@ <askfor在gmail.com> wrote:
> > > ¿ÉÄܵøÄdjango¡£
> > > ´ó¸ÅÊÇÕâÀï°É¡£ÎÒҲû²âÊÔ¡£
> > > core.urlresolvers.py
> > >
> > > class RegexURLPattern(object):
> > >     def __init__(self, regex, callback, default_args=None, name=None):
> > >         # regex is a string representing a regular expression.
> > >         # callback is either a string like '
> > > foo.views.news.stories.story_detail'
> > >         # which represents the path to a module and a view function
> > name, or
> > > a
> > >         # callable object (view).
> > >         self.regex = re.compile (regex, re.UNICODE)    #¼Óre.I
> > >
> > >
> > ÐÞ¸ÄÕýÔòʽ¾Í¿ÉÒÔÁËѽ¡£ÔÚÕýÔòÊ½Ç°Ãæ¼Ó(?i)±íʾºöÂÔ´óСд¡£¾ßÌåµÄ¿´reÄ£¿éµÄÎĵµ¡£
> >
> > --
> > I like python!
> > UliPad <>: http://code.google.com/p/ulipad/
> > meide <>: http://code.google.com/p/meide/
> > My Blog: http://www.donews.net/limodou
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> >
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071201/b4a54be3/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年12月01日 星期六 11:22

eho eho jiulang.eho在gmail.com
星期六 十二月 1 11:22:45 HKT 2007

Ŷ~Ô­À´ÕâÑù¾Í¿ÉÒÔ°¡£¬
make simple things easy and complex things possible¡£
¿´À´ÎÒ»¹ÊÇûÀí½âÕâÕÜѧ°¡£¬ºÇºÇ

ÔÚ07-12-1£¬1234 <mydjango在gmail.com> дµÀ£º
>
> ºÇºÇ »¹ÊÇ limodou À÷º¦ hoho~~~
>
> (r'^(?i)bbs/', include('wedding.apps.bbs.urls')),
>
> ÕâÑù¾Í½â¾öÁË ¹þ¹þ  лл¸÷λ
>
>
> ÔÚ07-11-30£¬@@ < askfor在gmail.com> дµÀ£º
> >
> > *(?iLmsux)* (One or more letters from the set "i", "L", "m", "s", " u",
> > "x".) The group matches the empty string; the letters set the
> > corresponding flags (re.I, re.L, re.M , re.S, re.U, re.X) for the entire
> > regular expression. This is useful if you wish to include the flags as part
> > of the regular expression, instead of passing a flag argument to the
> > compile() function.
> >
> > Note that the (?x) flag changes how the expression is parsed. It should
> > be used first in the expression string, or after one or more whitespace
> > characters. If there are non-whitespace characters before the flag, the
> > results are undefined.
> >
> >
> > º¹¡£·¢ÌùǰÕÒÁËÏÂÎĵµµÄ£¬½á¹û¿´µÃ²»¹»×Ðϸ¡£
> >
> >
> >  On 11/30/07, limodou <limodou在gmail.com> wrote:
> > >
> > > On Nov 30, 2007 4:41 PM, @@ < askfor在gmail.com> wrote:
> > > > ¿ÉÄܵøÄdjango¡£
> > > > ´ó¸ÅÊÇÕâÀï°É¡£ÎÒҲû²âÊÔ¡£
> > > > core.urlresolvers.py
> > > >
> > > > class RegexURLPattern(object):
> > > >     def __init__(self, regex, callback, default_args=None,
> > > name=None):
> > > >         # regex is a string representing a regular expression.
> > > >         # callback is either a string like '
> > > > foo.views.news.stories.story_detail'
> > > >         # which represents the path to a module and a view function
> > > name, or
> > > > a
> > > >         # callable object (view).
> > > >         self.regex = re.compile (regex, re.UNICODE)    #¼Óre.I
> > > >
> > > >
> > > ÐÞ¸ÄÕýÔòʽ¾Í¿ÉÒÔÁËѽ¡£ÔÚÕýÔòÊ½Ç°Ãæ¼Ó(?i)±íʾºöÂÔ´óСд¡£¾ßÌåµÄ¿´reÄ£¿éµÄÎĵµ¡£
> > >
> > > --
> > > I like python!
> > > UliPad <>: http://code.google.com/p/ulipad/
> > > meide <>: http://code.google.com/p/meide/
> > > My Blog: http://www.donews.net/limodou
> > > _______________________________________________
> > > python-chinese
> > > Post: send python-chinese在lists.python.cn
> > > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > > Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> > > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
> >
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to
> > python-chinese-request在lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071201/9ef9bb5c/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号