I'm working with this regular expression:
var SSN_REGEX = /^[A-Åa-å0-9,\!\-\?\""\. ]{3,999}$/;
This regex is used in a JavaScript function where I check for social security numbers.
function validateSSN(ssn){
if (SSN_REGEX.test(ssn)) {
javascript:addAppointment(document.forms[0])
alert("Valid SSN");
} else {
alert("Invalid SSN");
}
}
It's interesting that when I enter 12345Test
in Chrome, the regex passes without any issues. However, in Internet Explorer, strings cannot start with numbers causing some trouble. It feels like IE was specifically designed to make my life difficult. Any suggestions on how to tackle this issue?