U
U
Uncle Seryozha2016-11-14 09:11:05
Payment systems
Uncle Seryozha, 2016-11-14 09:11:05

Regular expression for masked bank card?

Help me write a regular expression to search DLP-system SearchInform for masked bank cards, for example, in the following format:
1) XXXX-XXXX-XXXX-4digits
2) XXXXXXXXXXXX4digits
There is a regular expression for searching for unmasked cards:
\b[3-6]\d{3 }[ \-_.]?(\d{4}[ \-_.]?){2}\d{4}\b {Bank card number
} Perl

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2016-11-14
@xmoonlight

(\d{4}([-]|)\d{4}([-]|)\d{4}([-]|)\d{4})

A
Andrew, 2016-11-14
@OLS

Do not forget about cards with lengths 18 and 19, and also that the first 6 digits - BIN - may not be masked

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question