I have a textfield accepting polish IBAN. How to check if given value is in correct format?
Solution 1 - more generalThe simplest solution that can be used in various cases is to use the "mask" and "maximum number of characters" parameter.
The “maximum number of characters” parameter is used to determine how many characters the user can enter into the field, and the mask parameter determines what characters can be entered (we use regular expressions).
Remember to define the mask-matching error message.
Solution 2 - case-specificWe can also use the "mask presentation" parameter, which in this particular case turns out to be a better solution. We can define that the field accepts only 26 digits in the appropriate format (this allows the text to be formatted in a more readable way). "Mask presentation", in contrast to the previous solution, will allow you to enter only those characters that we have included.