Hi,
I have the following jQuery validator that validates a UK postcode:
jQuery.validator.addMethod("UKPostcode", function(value, element) {
return this.optional(element) || /[A-Z]{1,2}[0-9R][0-9A-Z]? [0-9][ABD-HJLNP-UW-Z]{2}/.test(value);
}, "Must be a valid Postcode");
This matches against for e.g OL15 1HG, BUT it doesn’t match against ol15 1hg. The problem is that it doesn’t accept lowercase characters. I thought I could just use [A-Za-z] but that didn’t work.
Any ideas?
Thanks