Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#27945 closed Cleanup/optimization (fixed)

Clarify RegexValidator docs (match vs. search)

Reported by: Shubham Jain Owned by: Sean Fagan
Component: Documentation Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

The documentation says, RegexValidator matches the regex against the value, and hence ideally it must use regex.match but instead uses regex.search.

This looks like a bug.

Change History (8)

comment:1 Changed 4 years ago by Shubham Jain

Component: UncategorizedCore (Other)
Easy pickings: set
Has patch: set
Type: UncategorizedBug

comment:2 Changed 4 years ago by Tim Graham

Where's the documentation you quoted? 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.

comment:3 Changed 4 years ago by Shubham Jain

So the documentation 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".

Last edited 4 years ago by Shubham Jain (previous) (diff)

comment:4 Changed 4 years ago by Tim Graham

Component: Core (Other)Documentation
Has patch: unset
Summary: RegexValidator uses search instead of matchClarify RegexValidator docs (match vs. search)
Triage Stage: UnreviewedAccepted
Type: BugCleanup/optimization

comment:5 Changed 4 years ago by Sean Fagan

Owner: changed from nobody to Sean Fagan
Status: newassigned

comment:6 Changed 4 years ago by Sean Fagan

Has patch: set

comment:7 Changed 4 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 325db2a8:

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

comment:8 Changed 4 years ago by Tim Graham <timograham@…>

In b406c3ea:

[1.11.x] Fixed #27945 -- Clarified that RegexValidator searches with the regex.

Backport of 325db2a8c3453a56db5e0df0eed37476eb67802d from master

Note: See TracTickets for help on using tickets.
Back to Top