Good day to all...
We have experienced issues with a field value because it does not match the recommended 'pattern'. The user needs to enter her/his id on a form and it needs to match a built-in logic. My question has to do with the control at the field level to ensure that the value entered match at list one of 3 'patterns'
- Pattern 1 = must be 6 characters --> the first five characters must be numbers and the last one must be a number (example 12345A)
- Pattern 2 = must be 6 characters --> the first 2 characters must be 0 and N (for instance 0N1234)
- Pattern 3 = must be 6 characters --> First character is the letter C, characters 2 to 5 are numbers and last character is a letter (for instance C1234A)
My questions to all the gurus are: How could I put all these requirement into one (can you share the script with me)? and more generally, where to look for instructions on how to set up a character string to match a pattern?
Thanks a bunch for your (more than welcomed) help
http://regexlib.com/
Also, look at our Create New Field tool in our FREE Toolset to help you create a field with a custom Regular Expression:
http://www.formrouter.com/tools
The Regular Expression you want is something like (I am not sure whether you wanted to allow chars for pattern 2, and I always required upper case chars here):
^((0N\d{4})|(\d{6}[A-Z])|(Z\d{5}[A-Z]))$
Jim Healy, Founder & CEO FormRouter Inc.
Chapter Leader AUG RTP NC
http://www.formrouter.com