#NEWLINE# def wildcard_search( string , q ) : #NEWLINE# #INDENT# q_list = q . split ( '*' ) #NEWLINE# if all ( map ( ( lambda x : ( x == '' ) ) , q_list ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( q [ 0 ] not in string ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( q_list [ 0 ] == '' ) : #NEWLINE# #INDENT# tail = string #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( head , delimiter , tail ) = string . partition ( q_list [ 0 ] ) #NEWLINE# #UNINDENT# return wildcard_search ( tail , '*' . join ( q_list [ 1 : ] ) )