I have a form that I am validating with the jQuery validation plugin and for a gender field I want to only accept capital F or capital M. The regexp I’m using is (F|M){1} but it is passing both lowercase and uppercase F and M. Is there anything else I can do to prevent the lowercase ones from being validated?
I have a form that I am validating with the jQuery validation plugin and
Share
That regex looks fine to me, and the match should be case-sensitive by default.
Are you providing the
/imodifier to the regex accidentally, which would make it case insensitive?