Validation

ISO 4217 Currency Code

Validate 3-letter ISO 4217 currency codes (USD, EUR, GBP, JPY, etc.) — structural check only.

Try it in RegexPro →

Available in

JavaScript / ECMAScript code

jsJavaScript
const re = new RegExp("^[A-Z]{3}$", "");
const input = "USD";
const matches = [...input.matchAll(re)];
console.log(matches.map(m => m[0]));

Uses `String.prototype.matchAll` for global iteration (Node 12+ / all modern browsers).

Pattern

regexengine-agnostic
^[A-Z]{3}$

Raw source: ^[A-Z]{3}$

How it works

^[A-Z]{3}$ requires exactly three uppercase letters, anchored to the full string. This validates the FORMAT but not the existence of the code — pair with a lookup table to ensure it's a real ISO 4217 entry like USD, EUR, GBP.

Examples

Input

USD

Matches

  • USD

Input

JPY

Matches

  • JPY

Input

us

No match

Common use cases

  • Pricing form validation
  • Multi-currency invoice parsing
  • Financial data ingestion
  • Cross-border payment routing

Related patterns