1

I want to improve regex that works with the following string:

Uw BTW nummer NL80

IBAN NL 11abna0317164300asdfasf234

(SPACE)iBAN NL21ABNA0417134300 22

Iban: NL 29 ABNA 401422366f sdf

IBAN :NL 39 ABNA 0822416395s

And created regex failed to extract IBAN Mask on the 4th line. I want to improve it by allowing zero or one occurrence of colon (:) after IBAN and zero or one space after colon character.

(?<=[Ii][Bb][Aa][Nn]\s).*[Nn][Ll]\s?\d{2}\s?[a-zA-Z]{4}[0 ]\s?\d{9,10})

Regex demo:

https://regex101.com/r/zGDXa2/7

Much appreciated!

Allan
  • 11,650
  • 3
  • 27
  • 49
Ian Kuzin
  • 39
  • 5

0 Answers0