Regex Picker
Overview
This picker will be used by users and collect any string-like data and validate them using a regular expression.
Configuration
Required fields:
-
regularExpression
[string] Regular expression used to validate field -
errorMessage
[string] Error message that should appear if the validation fails -
flags
[string] Flags for the regular expressiong,i,s,m,y
. Refer to this documentation to better understand how flags work in the regular expression.
This picker is defined inside template.yaml
as shown:
parameters:
properties:
code:
title: Code
type: string
description: Device Code
# This field can contain the placeholder for the text area in the regex picker
ui:placeholder: 'E.g., 5 minutes, 1 hour'
validation:
errorMessage: Min 4 and max 10 alphabetic characters
regularExpression: ^[A-Z]{4,10}$
ui:field: RegexPicker