diff options
| author | seanfagan <seanfagandesign@gmail.com> | 2017-03-21 11:27:42 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-03-21 12:27:42 -0400 |
| commit | 325db2a8c3453a56db5e0df0eed37476eb67802d (patch) | |
| tree | 6acf09f7ce8ae33bfd0d959b98306f326b73d2cb | |
| parent | 43380e911073beab401a2fdeca0f25001e170dac (diff) | |
Fixed #27945 -- Clarified that RegexValidator searches with the regex.
| -rw-r--r-- | django/core/validators.py | 2 | ||||
| -rw-r--r-- | docs/ref/validators.txt | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/django/core/validators.py b/django/core/validators.py index ebc3f8958c..da1959c7d6 100644 --- a/django/core/validators.py +++ b/django/core/validators.py @@ -52,7 +52,7 @@ class RegexValidator: def __call__(self, value): """ - Validate that the input matches the regular expression + Validate that the input contains a match for the regular expression if inverse_match is False, otherwise raise ValidationError. """ if not (self.inverse_match is not bool(self.regex.search( diff --git a/docs/ref/validators.txt b/docs/ref/validators.txt index 50badc7222..e0da3fa530 100644 --- a/docs/ref/validators.txt +++ b/docs/ref/validators.txt @@ -85,8 +85,8 @@ to, or in lieu of custom ``field.clean()`` methods. .. attribute:: regex - The regular expression pattern to search for the provided ``value``, - or a pre-compiled regular expression. By default, raises a + The regular expression pattern to search for within the provided + ``value``, or a pre-compiled regular expression. By default, raises a :exc:`~django.core.exceptions.ValidationError` with :attr:`message` and :attr:`code` if a match is not found. That standard behavior can be reversed by setting :attr:`inverse_match` to ``True``, in which case |
