tmayfield
(Tammy Mayfield)
1
Can I use Advanced / Pattern in application studio to force a phone number to be in the correct format?
I’m trying to use something like:
^(+\d{1,2}\s)?(?\d{3})?[\s.-]\d{3}[\s.-]\d{4}$
I’ve looked thru the documentation but can’t tell what type of pattern it is expecting in advanced / pattern. Has anyone done this before?
hmwillett
(Hannah Willett)
2
Sure, but that RegEx string had some issues–not sure if some backslashes got formatted out or not.
This works:
^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$
Pass

Fail

tmayfield
(Tammy Mayfield)
3
It won’t allow me to enter any of those characters into the pattern. Am I missing something or is it my version 2024.1?
hmwillett
(Hannah Willett)
4
Ah, yeah–it was fixed in 2024.2 I believe.
tmayfield
(Tammy Mayfield)
5
Well then, I guess it will need to be a function with custom code. sigh
Thank you 
1 Like