Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
^\d{2}-\d{7}$
/
gm

Description

An Employer Identification Number (EIN) is also known as a Federal Tax Identification Number, and is used to identify a business entity. Generally, businesses need an EIN.

It expects 2 digits at start, then a dash ('-') and then 7 digits. No assumptions regarding the allowed prefixes, etc.

Submitted by @uazure - 7 months ago