def glob_escape(input_string):
 return re.sub((('(?P<char>[' + re.escape(GLOBBING_SPECIAL_CHARS)) + '])'), '[\\g<char>]', input_string)

def glob_escape ( input_string ) : return re . sub ( ( ( '(?P<char>[' + re . escape ( GLOBBING_SPECIAL_CHARS ) ) + '])' ) , '[\\g<char>]' , input_string )
escape all special characters .