Skip to main content

Regex Validator

Specification

{
"validatorType": String,
"name": String,
"description": String,
"fields": FieldSelectorSpec,
"pattern": String,
"onNullResult": String
"castFields": Boolean
}

Structure values

Field NameTypeDescriptionRequiredDefault
validatorTypeStringThe type of validator to constructRequired
nameStringThe name of the validator. Must be unique within the validation suite.Required
descriptionStringExpanded validator information.None
fieldsObjectA Field Selector SpecRequired
patternStringA regex pattern. Must be escaped inside of a JSON block.Required
onNullResultStringA value of pass, null, or fail that describes how to process null values. Null aggregates them into a null column. Pass aggregates them in with the other passing values. Fail aggregates them in with the other failing values.fail
castFieldsBooleanSpecifies if target fields should be cast to a string prior to validation.false

Example

{
"validatorType": "regex",
"name": "sample_regex_validator",
"description": "I can validate strings",
"fields": {
"fieldSelectorType": "Single",
"fieldName": "col_name"
},
"pattern": "\\w{4}", // the backslash in "\w" must be escaped,
"onNullResult": "pass",
"castFields": false
}