For jquery validation i need regex for SSN number format and EIN number format
EIN number like 52-4352452
SSN number like 555-55-5555
For SSN's:
http://regexlib.com/Search.aspx?k=ssn
For EINs:
http://regexlib.com/REDetails.aspx?regexp_id=1990
00-0000000
.^\d{2}\-?\d{7}$
<input type="text" id="ein1" value="0112345-67" />
<input type="text" id="ein2" value="01-1234567" />
<input type="text" id="ein3" value="011234567" />
<script type="text/javascript">
var patternEIN = /^\d{2}\-?\d{7}$/;
patternEIN.test($('#ein1').val()); // fail
patternEIN.test($('#ein2').val()); // pass
patternEIN.test($('#ein3').val()); // pass
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With