regexjquery-validate

Regex for EIN number and SSN number format in jquery


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


Solution

  • For SSN's:

    http://regexlib.com/Search.aspx?k=ssn

    For EINs:

    http://regexlib.com/REDetails.aspx?regexp_id=1990

    Corrected to include missing prefixes:

    /^([0][1-6]|1[0-6]|(?!70)[27][0-7]|(?!31)[35][0-9]|[468][0-8]|9[0-589])?\d{7}$/