Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
\b(5[1-5][0-9]{2}[ -])([0-9]{4}[ -]){2}[0-9]{4}\b|\b(5[1-5][0-9]{2})([0-9]{4}){3}\b|\b222[1-9][ -]([0-9]{4}[ -]){2}[0-9]{4}\b|\b222[1-9]([0-9]{4}){3}\b|\b22[3-9][0-9][ -]([0-9]{4}[ -]){2}[0-9]{4}\b|\b22[3-9][0-9]([0-9]{4}){3}\b|\b2[3-6][0-9]{2}[ -]([0-9]{4}[ -]){2}[0-9]{4}\b|\b2[3-6][0-9]{2}([0-9]{4}){3}\b|\b27[01][0-9][ -]([0-9]{4}[ -]){2}[0-9]{4}\b|\b27[01][0-9]([0-9]{4}){3}\b|\b2720[ -]([0-9]{4}[ -]){2}[0-9]{4}\b|\b2720([0-9]{4}){3}\b|\b(4[0-9]{3}[ -])([0-9]{4}[ -]){2}[0-9]\b|\b4[0-9][0-9]{11}\b|\b(4[0-9]{3}[ -])([0-9]{4}[ -]){2}(?:[0-9]{4})?$\b|\b4[0-9][0-9]{14}\b|\b(4[0-9]{3}[ -])([0-9]{4}[ -]){3}(?:[0-9]{3})?$\b|\b4[0-9][0-9]{17}\b|\b(34[0-9]{2}[ -])([0-9]{6}[ -])[0-9]{5}\b|\b34[0-9]{13}\b|\b(37[0-9]{2}[ -])([0-9]{6}[ -])[0-9]{5}\b|\b37[0-9]{13}\b|\b6(?:011|5[0-9]{2})[ -]([0-9]{4}[ -]){2}([0-9]{4})\b|\b6(?:011|5[0-9]{2})[0-9]{12}\b
/
gm

Description

no description available

Submitted by anonymous - 6 years ago