django之normalize函数的功能

Posted on 2018-06-30 15:13  王将军之武库  阅读(170)  评论(0)    收藏  举报
from django.utils.regex_helper import normalize
pat=r'^(?P<id>\d+)/(?P<name>\d+)$'
bits=normalize(pat)
print bits

结果是: [(u'%(id)s/%(name)s', [u'id', u'name'])]

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3