> Trac 0.12.3 (and current trunk at t.e.o) search uses the following:
> {{{
> def match_request(self, req):
> return re.match(r'/search(?:/opensearch)?$', req.path_info) is not
> None
> }}}
>
> ...which matches search at the end of any URL.No, re.match() matches at the beginning of the string. re.search() matches anywhere in the string. $ python Python 2.7.3 (default, Jun 18 2012, 20:21:41) [GCC 4.5.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> re.match(r'/search(?:/opensearch)?$', '/search') <_sre.SRE_Match object at 0xb76a8020> >>> re.match(r'/search(?:/opensearch)?$', '/search/opensearch') <_sre.SRE_Match object at 0xb76a8170> >>> re.match(r'/search(?:/opensearch)?$', '/search/something') >>> re.match(r'/search(?:/opensearch)?$', '/my/search') >>> re.search(r'/search(?:/opensearch)?$', '/my/search') <_sre.SRE_Match object at 0xb76a8020> -- Remy
signature.asc
Description: OpenPGP digital signature
