def reverse_helper(regex, *args, **kwargs):
 result = re.sub('\\(([^)]+)\\)', MatchChecker(args, kwargs), regex.pattern)
 return result.replace('^', '').replace('$', '')

def reverse_helper ( regex , * args , ** kwargs ) : result = re . sub ( '\\(([^)]+)\\)' , MatchChecker ( args , kwargs ) , regex . pattern ) return result . replace ( '^' , '' ) . replace ( '$' , '' )
does a "reverse" lookup -- returns the url for the given args/kwargs .