def find_match_command(self, rule):
command_string = rule['<STR_LIT>']<EOL>command_list = command_string.split()<EOL>self.logdebug('<STR_LIT>' %<EOL>(command_list, self.original_command_list))<EOL>if rule.get('<STR_LIT>'):<EOL><INDENT>self.logdebug('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>if (self.original_command_list[:len(command_list)] ==<EOL>command_list):<EOL><INDENT>self.logdebug('<STR_LIT>')<EOL>return {'<STR_LIT>': self.original_command_list}<EOL><DEDENT>else:<EOL><INDENT>self.logdebug('<STR_LIT>')<EOL><DEDENT><DEDENT>elif rule.get('<STR_LIT>'):<EOL><INDENT>if re.search(command_string, self.original_command_string):<EOL><INDENT>return {'<STR_LIT>': self.original_command_list}<EOL><DEDENT><DEDENT>elif command_list == self.original_command_list:<EOL><INDENT>return {'<STR_LIT>': command_list}<EOL><DEDENT>
Return a matching (possibly munged) command, if found in rule.