def METHOD_NAME(self, text, regexp, msg=None):
    import re
    if not hasattr(regexp, 'search'):
        regexp = re.compile(regexp)
    if regexp.search(text):
        self.fail("regexp %s MATCHED text %r" % (regexp.pattern, text))