RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Employer Identification Number (EIN)
Expression
^[1-9]\d?-\d{7}$
Description
Accepts valid EIN numbers. It could use a bit of tweaking because these are the current valid prefixes allowed. 1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 87, 88, 90, 91, 92, 93, 94, 95, 98, 99
Matches
55-5555555 | 1-2345678 | 99-9999999
Non-Matches
00-1111111 | my-einnumb | 5-55555
Author Rating: The rating for this expression. Brendan Enrick
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Up to date with the latest prefixes
Name: scull7
Date: 5/8/2018 6:28:07 AM
Comment:
^(0[1-6]||1[0-6]|2[0-7]|[345]\d|[68][0-8]|7[1-7]|9[0-58-9])-?\d{7}$ https://www.irs.gov/businesses/small-businesses-self-employed/how-eins-are-assigned-and-valid-ein-prefixes https://regex101.com/r/ASlLeu/2


Title: to handle all prefixes
Name: fish
Date: 3/22/2017 8:51:59 PM
Comment:
^[0-9]\d?-\d{7}$


Title: wtf do i do with this
Name: confused
Date: 10/27/2016 12:37:11 AM
Comment:
is this js? php? asp? wtf?


Title: To limit to actual prefixes
Name: Christopher
Date: 2/17/2016 9:28:56 PM
Comment:
^(0[1-6]||1[0-6]|2[0-7]|[35]\d|[468][0-8]|7[1-7]|9[0-58-9])-\d{7}$ Note this won't stay up to date if new prefixes are added.


Title: Don't match 00-
Name: Christopher
Date: 2/17/2016 9:13:36 PM
Comment:
Cannot begin with "00-" This is slightly stricter (although it still matches other prefixes that don't exist). ^(0[1-9]|[1-9]\d)-\d{7}$


Title: Doesn't match leading zero
Name: Dean Moriarty
Date: 10/24/2011 1:29:19 PM
Comment:
Doesn't match 03-0235372. I'm using ^\d{2}-\d{7}$ which doesn't check for valid campus. See http://en.wikipedia.org/wiki/Employer_Identification_Number.


Title: Incorrect
Name: chia
Date: 4/4/2011 3:43:47 PM
Comment:
This is actually not correct validation. 020532420 will fail, and this is a valid EIN. ^[0-9]{2}\-?\d{7}$


Title: Incorrect
Name: chia
Date: 4/4/2011 3:43:33 PM
Comment:
This is actually not correct validation. 020532420 will fail, and this is a valid EIN. ^[0-9]{2}\-?\d{7}$


Copyright © 2001-2018, RegexAdvice.com | ASP.NET Tutorials