code: def matches(self, s):
      
      regex_matches = self.compiled_regex.search(s) is not None
      return not regex_matches if self.inverted else regex_matches
docs: Whether the pattern matches anywhere in the string s.