Hi all,
I've been struggling with some regex validation. I'm building a survey that has a text entry field, and the entry has to follow the format:
##/#####
That is, it must be 2 numbers followed by a forward slash "/" followed by 5 more numbers. I thought the below regex would work, but unfortunately it isn't.
[0-9]{2} [\\/] [0-9]{5}
Can anyone tell me what the regex expression needs to be?
Solved
Help with Regex validation
Best answer by Phillip
I solved my problem and in good forum etiquette I'm posting the solution in case anyone else ever has the same problem.
The solution is:
^[0-9]{2,2}[\\/][0-9]{5,5}$
Just another watch out, I had a setting wrong in my Custom Validation. I previously had it set to "Is Equal to". I think when you click in and out of custom valuation, it automatically resets to "Is Equal to". The setting you need is "Matches Regex".
Image attached.
Leave a Reply
Rich Text Editor, editor1
Editor toolbars
Press ALT 0 for help
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.