I've the following working REGEX code set as validation rule when we create an account. I've create a Flow and set this REGEX as pattern into a phone number field in Flow screen input validation and it doesn't return any error:

NOT(REGEX({!ProfessionalPhone}, "\\+[0-9 ]+((x|([Ee]xt[\\.:]?\\s?))\\d+)?$"))

Flow input screen

The result should be that it allows only phone numbers starting with + for intl code, digits, and eventually, ext.123 if any. sample: +1 888 452 1231 ext1234 No dashes are allowed neither dots.

I can type anything, no error is reported...

However, if I set the field as {!ProfessionalPhone.value}, whatever I set, it returns an error.

Any clue what I've missed here? Dave

  • Are you sure that regex works? I tested it out here, with your example number, and it does not match. regexr.com There are a few examples of international phone regexes on this StackOverflow post, but it's definitely a complicated pattern to match. – nbrown May 26 '20 at 19:46

Could it be that you are missing the "beginning" of the string match? (^)

"^\\+[0-9 ]+((x|([Ee]xt[\\.:]?\\s?))\\d+)?$"

You are using the phone component, just need to put your regular expression without literals, ^(([0-9]{3}) |[0-9]{3}-)[0-9]{3}-[0-9]{4}$ The REGEX formula is to be use in Validate Input in Text input components.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.