Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 2nd, 2012  |  syntax: None  |  size: 0.48 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Regexp matching except
  2. ^/profile/(?!attributes|essays|edit)$
  3.        
  4. ^/profile/(?!attributes|essays|edit).*$
  5.        
  6. ^/profile/(?!attributes|essays|edit)
  7.        
  8. ^/profile/(?!(?:attributes|essays|edit)$)
  9.        
  10. def mpath(path, ignore_str = 'attributes|essays|edit',anything = True):
  11.     any = ''
  12.     if anything:
  13.         any = '.*?'
  14.     m = re.compile("^/profile/(?!(?:%s)%s($|/)).*$" % (ignore_str,any) )
  15.     match = m.search(path)
  16.     if match:
  17.         return match.group(0)
  18.     else:
  19.         return ''