1

I'm using the regex code below to mask the credit card numbers on my application but it seems I'm also masking IBAN numbers which I would like to mask, has anyone faced this issue before? Does anyone know the patron for IBAN numbers and how to keep them visible while masking the credit card numbers at the same time?

(?>^|(?<=[\s\w;[:alpha:](),.:;?!"'`>]))\b(?>4\d{3}|5[1-5]\d{2}|6011|622[1-9]|64[4-9]\d|65\d{2})[ -.=\n\r]{0,4}\d{4}[ -.=\n\r]{0,4}\d{4}[ -.=\n\r]{0,4}\d{4}\b|((?>3[47]\d{2})[ -.]?\d{6}[ -.]?\d{5})(?>$|(?=[\s\w[:alpha:](),.:;?!"'`<=&nbsp;]))

Thanks

RTYX
  • 1,244
  • 1
  • 14
  • 32
Cristian
  • 11
  • 1
  • IBAN numbers start with a two-letter country code. The length of the account number depends on the country code so there is no fixed pattern for the numbers. – tripleee Nov 25 '19 at 10:53

0 Answers0