code: def matches(self, regex, flags=0):
          
          return self._generate_test(
              lambda value: re.match(regex, value, flags),
              ('matches', self._path, regex)
          )
docs: Run a regex test against a dict value (whole string has to match).
  
          >>> Query().f1.matches(r'^\w+$')
  
          :param regex: The regular expression to use for matching