Update pattern to support Perl /pattern/modifiers convention

This commit is contained in:
Scott Williams
2016-05-09 01:11:29 +01:00
parent fed22a1f72
commit 25ebd5466d
6 changed files with 62 additions and 6 deletions

View File

@@ -279,7 +279,7 @@ class FormatTest(object):
if not string:
raise ValueError("Invalid value for `string`, must not be `None`")
if not re.match('/[a-z]/i', string):
if not re.search('[a-z]', string, flags=re.IGNORECASE):
raise ValueError("Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`")
self._string = string