Regex validator for contact no

Hi team,

I have try a set of regular expression on online tools.
The result perfect match with my input.

image

However, when I copy and paste the same things into RegexValidator, it shows me ERROR in Invalid ICU message. Missing '}'
^(+\d{3}\s)?(?\d{2,3})?\d{3,4}[\s]\d{4}?$

Try escaping all \ symbols with \\ - the Pattern property is a string. In addition you may need to create a page property and assign the pattern to it. Then set the Pattern property of the component to said page property.

Hi @korchev ,

This is another regexValidator that I used, and this pattern is working fine for me.

I did try also replace all '' with '\', but it still not working.

image

It seems that angular localization is having trouble parsing this property. Did you try my suggestion to use a page property instead?

Yes, I did try to set the regular expression in Page Property, after that set the property into the pattern field. But is still not working.

I realized that this type of regular expression is working in Radzen ^[1-9]\d(.\d+)?$*
But ^(+\d{3}\s)?(?\d{2,3})?\d{3,4}[\s]\d{4}$ is not working.

The different between them is { }. Any way to handle this?

image

What isn't working? Are you still getting the ICU message error?

This time is getting another error.

Did you put quotes around the regexp pattern? Check the generated code.