def escape_query(search_strings):
 result = []
 for search_string in search_strings:
  result.append(search_string)
  short_query = re.sub(u"'", u'', search_string)
  if (search_string != short_query):
   result.append(short_query)
   very_short_query = re.sub(u"'[a-z]", u'', search_string)
   if (short_query != very_short_query):
    result.append(very_short_query)
 return result

def escape_query ( search_strings ) : result = [ ] for search_string in search_strings : result . append ( search_string ) short_query = re . sub ( u"'" , u'' , search_string ) if ( search_string != short_query ) : result . append ( short_query ) very_short_query = re . sub ( u"'[a-z]" , u'' , search_string ) if ( short_query != very_short_query ) : result . append ( very_short_query ) return result
escaping some expression greys -> greys + greys + grey .