-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
Description
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:
regex_str: constr(regex='^apple (pie|tart|sandwich)$')
Alternatively, it could use re.fullmatch() but that would change the behavior of the validator.
mstykow and justmars