Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
\b[A-Z]{2}[0-9]{2}(?:[ ]?[0-9]{4}){4}(?!(?:[ ]?[0-9]){3})(?:[ ]?[0-9]{1,2})?\b
/
gm
Input 1
1
New
This IBAN looks ok AB12 1234 1234 1234 1234 at first glance Also this AB12 1234 1234 1234 1234 1 seems fine And AB12 1234 1234 1234 1234 12 passes Or without spaces AB123456789012345678 We'll find this AB1234567890123456789 also Even the longer AB12345678901234567890 matches Not allowed ------------ AB12 1234 1234 1234 123 (to few numbers) AB12 1234 1234 1234 1234 123 (to many numbers) 1234 1234 1234 1234 1234 (starts with numbers)