You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It might be helpful to clarify that the constr type validator's regex argument uses re.match() which only requires a partial match on the string. This personally bit me as I assumed the ^ and $ weren't required and put a length restriction in the expression but the field validated as the start of the string matched.
Updating the example in the documentation would probably cover it:
Thanks for reporting, perhaps fullmatch would have been a good idea, but we can't really change the behaviour until v2 (if you think that's a good idea, I guess create a clear new issue).
In terms of documentation, I completely, PR very welcome.
It might be helpful to clarify that the
constr
type validator'sregex
argument usesre.match()
which only requires a partial match on the string. This personally bit me as I assumed the^
and$
weren't required and put a length restriction in the expression but the field validated as the start of the string matched.Updating the example in the documentation would probably cover it:
Alternatively, it could use
re.fullmatch()
but that would change the behavior of the validator.The text was updated successfully, but these errors were encountered: