Regular Expressions 101

Library entries

MasterCard - 10/09/18

Vote

0

Regular Expression
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
/
gm

Description

Loading markdown...
Submitted by anonymous - 3 years ago