
Untitled
By: a guest on
Jun 2nd, 2012 | syntax:
None | size: 0.48 KB | hits: 11 | expires: Never
Regexp matching except
^/profile/(?!attributes|essays|edit)$
^/profile/(?!attributes|essays|edit).*$
^/profile/(?!attributes|essays|edit)
^/profile/(?!(?:attributes|essays|edit)$)
def mpath(path, ignore_str = 'attributes|essays|edit',anything = True):
any = ''
if anything:
any = '.*?'
m = re.compile("^/profile/(?!(?:%s)%s($|/)).*$" % (ignore_str,any) )
match = m.search(path)
if match:
return match.group(0)
else:
return ''