EasyRegex Logo
EasyRegex
Neu

Match IBAN in Javascript

Javascript

Regulärer Ausdruck

\b[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{4}[0-9]{7}([a-zA-Z0-9]?){0,16}\b
Kopieren
Haben Sie Feedback?

Erklärung

This regex pattern matches International Bank Account Numbers (IBAN). It starts with two letters, followed by two digits, then four alphanumeric characters, and finally 7 to 24 characters which can be alphanumeric. The \b ensures that the IBAN is a whole word.

Javascript

Beispielverwendung

const regex = /\b[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{4}[0-9]{7}([a-zA-Z0-9]?){0,16}\b/;
const iban = 'GB29 NWBK 6016 1331 9268 19';
console.log(regex.test(iban)); // Output: true
Kopieren
Testen Sie den Ausdruck

Ähnliche Reguläre Ausdrücke