IBAN (International Bank Account Number)
Validate IBAN bank account identifiers: 2-letter country code, 2 check digits, 11–30 alphanumerics.
Try it in RegexPro →Available in
JavaScript / ECMAScript code
const re = new RegExp("^[A-Z]{2}\\d{2}[A-Z0-9]{11,30}$", "");
const input = "GB29NWBK60161331926819";
const matches = [...input.matchAll(re)];
console.log(matches.map(m => m[0]));Uses `String.prototype.matchAll` for global iteration (Node 12+ / all modern browsers).
Python (re) code
import re
pattern = re.compile(r"^[A-Z]{2}\d{2}[A-Z0-9]{11,30}$")
input_text = "GB29NWBK60161331926819"
for m in pattern.finditer(input_text):
print(m.group(0))Stdlib `re` module — no third-party dependency. Works on Python 3.6+.
Go (RE2) code
package main
import (
"fmt"
"regexp"
)
func main() {
re := regexp.MustCompile(`^[A-Z]{2}\d{2}[A-Z0-9]{11,30}$`)
input := `GB29NWBK60161331926819`
for _, match := range re.FindAllString(input, -1) {
fmt.Println(match)
}
}Uses `regexp.MustCompile` (panics on bad patterns at startup) and `FindAllString` for all matches.
Pattern
^[A-Z]{2}\d{2}[A-Z0-9]{11,30}$Raw source: ^[A-Z]{2}\d{2}[A-Z0-9]{11,30}$
How it works
Examples
Input
GB29NWBK60161331926819Matches
GB29NWBK60161331926819
Input
DE89370400440532013000Matches
DE89370400440532013000
Input
1234567890No match
—Common use cases
- •SEPA payment form validation
- •International invoice processing
- •KYC and onboarding flows
- •Payment file (XML/CSV) ingestion pipelines
Related patterns
International Phone Number (Loose)
ValidationMatch international phone numbers in a variety of loose formats including country codes, area codes, and separators.
International Phone (E.164)
ValidationValidate phone numbers in ITU-T E.164 international format: a + sign followed by 2–15 digits, first digit non-zero.
ISO 3166-1 alpha-2 Country Code
ValidationValidate 2-letter ISO 3166-1 alpha-2 country codes (US, GB, FR, JP, etc.) — structural check only.
ISO 4217 Currency Code
ValidationValidate 3-letter ISO 4217 currency codes (USD, EUR, GBP, JPY, etc.) — structural check only.