Provides a string validator. More...
Import Statement: | import QtQuick 2.11 |
Instantiates: | QRegExpValidator |
The RegExpValidator type provides a validator, which counts as valid any string which matches a specified regular expression.
This property holds the regular expression used for validation.
Note that this property should be a regular expression in JS syntax, e.g /a/ for the regular expression matching "a".
By default, this property contains a regular expression with the pattern .* that matches any string.
Below you can find an example of a TextInput object with a RegExpValidator specified:
TextInput { id: hexNumber validator: RegExpValidator { regExp: /[0-9A-F]+/ } }
Some more examples of regular expressions:
/\d{1,3}(?:,\d{1,3})+$/
/(\d{1,3})([.,]\d{1,2})?$/
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: