How to use custom validation with wildcards? | XM Community
Skip to main content
Solved

How to use custom validation with wildcards?

  • October 15, 2018
  • 4 replies
  • 68 views

Hi, I am trying to include a custom validation in my survey that checks if an email address is in the right format. I am trying to check for a single letter followed by a . (dot) followed by an undefined amount of characters. I also want it to check that our domain is not included. For example address f.manchester (validates True) m.bob (validates True) mhoward (validates False) m.bob@snhu.edu (validates False) I've read similar threads where people do this with numbers but I couldn't find anything with people doing it with letters. Thanks for your help!

Best answer by TomG

Use regex: ^[a-z]\\\\.[a-z]{1,}$

4 replies

PeeyushBansal
Level 6 ●●●●●●
Forum|alt.badge.img+43
  • Level 6 ●●●●●●
  • October 15, 2018
In custom validation add conditions like if doesn't contains "." or does not contain ".com" it throw error.

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • October 15, 2018
Use regex: ^[a-z]\\\\.[a-z]{1,}$

Thanks, TomG that worked! Is there a way for the characters after the (.) to be either letters or numbers? Forget my names could also include numbers at times and the numbers could be double digits at times.

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • October 15, 2018
> @workerbee2018 said: > Thanks, TomG that worked! Is there a way for the characters after the (.) to be either letters or numbers? Forget my names could also include numbers at times and the numbers could be double digits at times. ^[a-z]\\\\.[a-z0-9]{1,}$