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
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).
Python (re) code
import re
pattern = re.compile(r"^[A-Z]{3}$")
input_text = "USD"
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]{3}$`)
input := `USD`
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]{3}$Raw source: ^[A-Z]{3}$
How it works
Examples
Input
USDMatches
USD
Input
JPYMatches
JPY
Input
usNo match
—Common use cases
- •Pricing form validation
- •Multi-currency invoice parsing
- •Financial data ingestion
- •Cross-border payment routing
Related patterns
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.
Canadian Postal Code
ValidationMatch Canadian postal codes in the A1A 1A1 or A1A1A1 format with valid first-letter prefixes.
SWIFT / BIC Code
ValidationValidate SWIFT/BIC bank identifier codes — 8 chars (head office) or 11 chars (branch).
IBAN (International Bank Account Number)
ValidationValidate IBAN bank account identifiers: 2-letter country code, 2 check digits, 11–30 alphanumerics.