I am trying to extract this text \"NL dd ABNA ffffdffffdffffd\" from string:
IBAN NL 91ABNA0417463300 IBAN NL91ABNA0417164300 Iban: NL 69 ABNA 402032566
You can just remove all spaces and uppercase the rest, Like this:
iban = NL 91ABNA0417463300 iban.replace(" ", "") iban.upper()
And then your regex would be:
NL\d{2}ABNA(\d{10}|\d{9})
It works in https://regex101.com/r/zGDXa2/1