(value)
| 339 | :param flags: regex flags to pass to ``re.match`` |
| 340 | """ |
| 341 | def test(value): |
| 342 | if not isinstance(value, str): |
| 343 | return False |
| 344 | |
| 345 | return re.match(regex, value, flags) is not None |
| 346 | |
| 347 | return self._generate_test(test, ('matches', self._path, regex)) |
| 348 |