def parse_replace_hook(s):
 (patt, regex, replacement) = _parse_hook(s)
 try:
  re.compile(regex)
 except re.error as e:
  raise ParseException(('Malformed replacement regex: %s' % str(e.message)))
 return (patt, regex, replacement)

def parse_replace_hook ( s ) : ( patt , regex , replacement ) = _parse_hook ( s ) try : re . compile ( regex ) except re . error as e : raise ParseException ( ( 'Malformed replacement regex: %s' % str ( e . message ) ) ) return ( patt , regex , replacement )
returns a tuple .