We are currently working on the forum. For the short-term, all forum content will be in read-only format. We apologize for the interruption and look forward to collaborating with you shortly. All the best in your research!
I ask for help because I can not run the validation function in a field that must contain the initials of the patient in the format "nn" (name) and "ss" (surname).
I use the syntax: regexp: /[A-z]{2}/
Unfortunately, however, if that field is filled in with numbers or letters with numbers greater than 3, I can not display the validation error message expected.
You mean that you only want to allow exactly two lower case letters? I think your mix of capital and lowercase letters is not making it work.
I'm not a regex wiz, but this would be a crude way of doing it. If someone would write three letters for example, it would still match up the two letters.
regexp: /[a-z][a-z]/
or
regexp: /[a-z]{2}/
I find this tool below useful for testing my regular expressions: http://regexpal.com/
Comments
You mean that you only want to allow exactly two lower case letters? I
think your mix of capital and lowercase letters is not making it work.
I'm not a regex wiz, but this would be a crude way of doing it. If someone
would write three letters for example, it would still match up the two
letters.
regexp: /[a-z][a-z]/
or
regexp: /[a-z]{2}/
I find this tool below useful for testing my regular expressions:
http://regexpal.com/
I'd recommend that you use javascript for validating the length of a string field. see example here:
http://www.trialdatasolutions.com/tds/howto/charcount.jsp
^[a-z]{2}$
http://regex101.com/#Javascript