How do I create a validation where I need to enter a study ID that has letters and numbers | XM Community
Skip to main content
Solved

How do I create a validation where I need to enter a study ID that has letters and numbers

  • December 17, 2018
  • 5 replies
  • 75 views

I need to create a validation that's 12 charters (letters and numbers). Can someone provide the right regex strip to provide into the custom validation box? Thank you

Best answer by Anonymous

Hello @salmeida , Use this regex code: `^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{12}$` The above will force respondent to enter 12 charters (letters and numbers)

5 replies

  • Answer
  • December 17, 2018
Hello @salmeida , Use this regex code: `^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{12}$` The above will force respondent to enter 12 charters (letters and numbers)

  • Author
  • December 17, 2018
Hi, thanks for you help but when I preview the survey it still doesn't work

  • December 17, 2018
> @salmeida said: > Hi, thanks for you help but when I preview the survey it still doesn't work > I hope you are using match regex option in custom validation

  • Author
  • December 17, 2018
Yes I am !

  • Author
  • December 17, 2018
Never mind it worked!! Thanks so much for your help!!!