def parse_like_term(term):
 if term.startswith('^'):
  return '^{}'.format(re.escape(term[1:]))
 elif term.startswith('='):
  return '^{}$'.format(re.escape(term[1:]))
 return re.escape(term)

def parse_like_term ( term ) : if term . startswith ( '^' ) : return '^{}' . format ( re . escape ( term [ 1 : ] ) ) elif term . startswith ( '=' ) : return '^{}$' . format ( re . escape ( term [ 1 : ] ) ) return re . escape ( term )
parse search term into tuple .