Help with a regex to validate a text entry field. | XM Community
Skip to main content
Solved

Help with a regex to validate a text entry field.

  • July 11, 2019
  • 1 reply
  • 90 views

Riboloni
Level 1 ●
Forum|alt.badge.img+4
Hello I have a text entry question for respondents to insert their PIN. PINs are 10 characters long: 9 numerical digits and end with a letter. They always start with '00', so they would look like this: 001234567A I have selected a custom validation for which I want the entered text to match a regex statment but I am not familiar with regex sintax and would appreciate any help. Thank you!

Best answer by GrayMatterThinking

Hi - is the letter at the end case-insensitive? If it is then use the following: `^00[0-9]{7}[A-Za-z]$` If the letter has to be uppercase then it would just be: `^00[0-9]{7}[A-Z]$`

1 reply

GrayMatterThinking
Level 2 ●●
Forum|alt.badge.img+4
Hi - is the letter at the end case-insensitive? If it is then use the following: `^00[0-9]{7}[A-Za-z]$` If the letter has to be uppercase then it would just be: `^00[0-9]{7}[A-Z]$`