소스 검색

Fixed #27945 -- Clarified that RegexValidator searches with the regex.

seanfagan 8 년 전
부모
커밋
325db2a8c3
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      django/core/validators.py
  2. 2 2
      docs/ref/validators.txt

+ 1 - 1
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(

+ 2 - 2
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