Learn more about the Blueriq validation types BankAccount, IBAN, Date, Number, Regex, SofiNumberValidator, StringLength.
Index: The following validation types are available in the Blueriq library:
...
Panel |
---|
|
Date
Use this type to construct validations for specific date formats. You can use this validation on attributes that have base type date. Syntax Code Block |
---|
<comparedate><comparator><compareday><comparemonth><compareyear> |
comparedate - Compare the attribute value to a specific date, the dateformat of this date should be 'yyyy/MM/dd'. comparator - The type of comparison, this can be 'less', 'equal' and 'greater'. compareday - There are three options: a number between 1 and 31; the day part of the attribute value is compared with this value. '+' followed by a number; the day part of the attribute value is compared with the current day '+' the specified number. '–' followed by a number; the day part of the attribute value is compared with the current day '–' the specified number.
comparemonth - There are three options: a number between 1 and 12; the month part of the attribute value is compared with this value. '+' followed by a number; the month part of the attribute value is compared with the current month '+' the specified number. '–' followed by a number; the month part of the attribute value is compared with the current month '–' the specified number.
compareyear - There are three options: a number; the year part of the attribute value is compared with this value. '+' followed by a number; the year part of the attribute value is compared with the current year '+' the specified number. '–' followed by a number; the year part of the attribute value is compared with the current year '–' the specified number.
Examples Suppose that TODAY = 07-10-2004.
Explanation | Validation rule |
---|
value = 01-02-2004 | <2004/02/01><equal> | value > 1 month from today | <><greater><><+1> | value < 1 year ago | <><less><><><-1> |
|
Panel |
---|
|
Number
This type checks the boundaries of an attribute with base type number, integer, currency or percentage. Syntax Code Block |
---|
<maxIncl><minIncl><maxExcl><minExcl> |
maxIncl - The attribute value should be less than or equal to this value. minIncl - The attribute value should be greater than or equal to this value. maxExc - The attribute value should be less than this value. minExcl - The attribute value should be greater than this value.
Examples
Parameters | Value | Result |
---|
<><0> | 0 | valid | <><><><0> | 0 | invalid | <><><><0> | 1 | valid | <120><><><0> | 120 | valid | <><><120><0> | 120 | invalid | <><><120><0> | 119 | valid | <5.1345><><><1.2345> | 5.1345 | valid | <5.1345><><><1.2345> | 1.2345 | invalid |
|
Panel |
---|
|
Regexp
This validation type checks whether a string value is part of a specified set of strings. You can use this type to validate a string as a correct postal code format, telephone number or email address. Syntax Code Block |
---|
<posRegExp><negRegExp> |
The following characters are allowed in these regular expressions: Code Block |
---|
^[0-9]{4}\s{0,1}(?)[a-zA-Z]{2}$ |
The regular expressions used in several Blueriq Studio functions are common Java 1.4 expressions. For a complete documentation we refer to the online java documentation. UI Text Box |
---|
| When writing regular expressions, you should make sure that they do not make the system vulnerable to ReDos attacks. The system can give a denial of service when an evil expression is used, that takes very long to evaluate by the parser. Examples of evil regular expressions: - (a+)+
- ([a-zA-Z]+)*
- (a|aa)+
- (a|a?)+
- (.*a){x} | for x > 10
The above are suspectible to aaaaaaaaaaaaaaaaaaaaaaaa! It is difficult to give general rules that make sure that your expression is not evil, and even recognizing them can be hard. When writing regular expressions, consider Atomic Groups which help to avoid the evil behavior. |
Examples Postal code Code Block |
---|
<^[0-9]{4}( ?)[a-zA-Z]{2}$> |
Value | Result |
---|
“1000 AA” | valid | “1000AA” | valid | “10001AA” | invalid |
Telephone number Code Block |
---|
<(^\+[0-9]{2}|^\+[0-9]{2}\(0\)|^\(\+[0-9]{2}\)\(0\)|^00[0-9]{2}|^0)([0-9]{9}$|[0-9\-\s]{10}$)> |
Value | Result |
---|
“010 1234567” | valid | “+31(0)10 1234567” | valid | “010-1234567” | valid | “010 123456789” | invalid |
E-mail address Code Block |
---|
<^.+@[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4})$><(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)|\s> |
Value | Result |
---|
“test@email.nl” | valid | “test@email.failure” | invalid |
|
...
Panel |
---|
|
StringLength
This type validates the length of a string value. Syntax Code Block |
---|
<minLength><maxLength> |
Examples
Parameters | Value | Result |
---|
<><5> | “john” | valid | <2><> | “a” | invalid | <4><8> | “username” | valid |
|
UI Expand |
---|
|
Content by Label |
---|
showLabels | false |
---|
max | 5 |
---|
cql | label in ("validation","validations","validationtype") |
---|
|
|
...