code: def assertRegex(self, regexp, msg=None):
      import re
  
      pattern = re.compile(regexp)
      for r in self.records:
          if pattern.search(r.getMessage()):
              return True
      if msg is None:
          msg = "Pattern '%s' not found in logger records" % regexp
      assert 0, msg
  
imports: import sys
  import logging
  import timeit
  from functools import wraps
  from collections.abc import Mapping, Callable
  import warnings
  from logging import PercentStyle
label_desc: Use image node_id 5 for calling the CapturingLogHandler obj's underlying member method code with example usage: obj.assertRegex(regexp, msg) and returns: True