gws.plugin.model_validator.regex¶
Regular expression validator for strings.
Checks that the field value is a string that matches a regular expression.
The match uses re.search, so the expression can match anywhere in the
value; add ^ and $ anchors to match the whole value. A value that is
not a string fails the check.
Example:
fields+ {
name "zip"
type "text"
validators+ { type "regex" regex "^[0-9]{5}$" }
}
Source code: gws.plugin.model_validator.regex
Package Contents¶
- class gws.plugin.model_validator.regex.Config¶
Bases:
gws.base.model.validator.ConfigChecks that a value matches a regular expression.