This looks like a bug.
--
Ticket URL: <https://code.djangoproject.com/ticket/27945>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* type: Uncategorized => Bug
* has_patch: 0 => 1
* component: Uncategorized => Core (Other)
* easy: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/27945#comment:1>
Comment (by Tim Graham):
Where's the documentation you quoted?
[https://docs.djangoproject.com/en/dev/ref/validators/#django.core.validators.RegexValidator.regex
I see], "The regular expression pattern to search for the provided value".
Presumably the documentation you mentioned should be fixed since changing
behavior would be backwards incompatible.
--
Ticket URL: <https://code.djangoproject.com/ticket/27945#comment:2>
Comment (by Shubham Jain):
So the
[documentation](https://docs.djangoproject.com/en/dev/ref/validators/#django.core.validators.RegexValidator.regex)
says, "regex pattern to search for provided value". I suppose this means,
you try to see if value fits in the regex. But instead it sees if regex
fits anywhere in the value. So in documentation, it must be "regex pattern
to search for, in the provided value".
--
Ticket URL: <https://code.djangoproject.com/ticket/27945#comment:3>
* type: Bug => Cleanup/optimization
* has_patch: 1 => 0
* stage: Unreviewed => Accepted
* component: Core (Other) => Documentation
--
Ticket URL: <https://code.djangoproject.com/ticket/27945#comment:4>
* status: new => assigned
* owner: nobody => Sean Fagan
--
Ticket URL: <https://code.djangoproject.com/ticket/27945#comment:5>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/8203 Pull Request] added
--
Ticket URL: <https://code.djangoproject.com/ticket/27945#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"325db2a8c3453a56db5e0df0eed37476eb67802d" 325db2a8]:
{{{
#!CommitTicketReference repository=""
revision="325db2a8c3453a56db5e0df0eed37476eb67802d"
Fixed #27945 -- Clarified that RegexValidator searches with the regex.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27945#comment:7>
Comment (by Tim Graham <timograham@…>):
In [changeset:"b406c3ea2889b386efc5d97999ff1de3c2ddf128" b406c3ea]:
{{{
#!CommitTicketReference repository=""
revision="b406c3ea2889b386efc5d97999ff1de3c2ddf128"
[1.11.x] Fixed #27945 -- Clarified that RegexValidator searches with the
regex.
Backport of 325db2a8c3453a56db5e0df0eed37476eb67802d from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27945#comment:8>