Home > Forum > Forms > Regular expression problem

Regular expression problem
0

I found a problem on WEBCON with regular expression. In the attributes, in the "Style and behavior" tab, in the Regular expression for validation field. In my case, I set a limit to 11 digits (11 characters long, as in the Polish PESEL number) - "\ d {11}" to be precise. This regular expression works and detects the shorter string as bad. She recognizes even 11 digits as correct, that's good. More characters (e.g. 12 and not recognized as an error and allows you to proceed further on the form.
Does this also happen with you?
Is this invalid regular expression in WEBCON?

MVP

Hi Radek,

that's the correct behavior as you have not specified that after the 11 digits nothing else should follow. Actually even a string like a12345678901asd would be a match.
You can easily test the regex using the online tool which is linked in the designer studio.
If you want that only 11 digits should be present you could use

^\d{11}$

^ = Beginning of the string
$ = End of the string

Best regards,
Daniel