def line_matches(self, str, match_messages_regex, ignore_messages_regex):
'''
@summary: This method checks whether given string matches against the
set of regular expressions.
@param str: string to match against 'match' and 'ignore' regex expressions.
A string which matched to the 'match' set will be reported.
A string which matches to 'match' set, but also matches to
'ignore' set - will not be reported (will be ignored)
@param match_messages_regex:
regex class instance containing messages to match against.
@param ignore_messages_regex:
regex class instance containing messages to ignore match against.
@return: True is str matches regex criteria, otherwise False.
'''
ret_code = False
if ((match_messages_regex is not None) and (match_messages_regex.findall(str))):
if (ignore_messages_regex is None):
ret_code = True
elif (not ignore_messages_regex.findall(str)):
self.print_diagnostic_message('matching line: %s' % str)
ret_code = True
return ret_code
#---------------------------------------------------------------------
评论列表
文章目录