HomeRegex LibraryAmerican Express (Amex) Card Regex
100% Client-Side β€’ 0 B Data Leaves Browser
security

American Express (Amex) Card Regex

Validates 15-digit American Express credit cards starting with prefixes 34 or 37.

Regular Expression Pattern:
/^3[47][0-9]{13}$/
Valid Match Example:
378282246310005
Invalid / Non-Match Example:
388282246310005

Regex Syntax Breakdown & Explanation

  • β€’^3[47] : Amex cards strictly begin with either 34 or 37
  • β€’[0-9]{13}$ : Exactly 13 digits follow for a 15-digit total card number

Implementation in Popular Languages

JavaScript / TypeScript
const regex = /^3[47][0-9]{13}$/;
const isValid = regex.test("378282246310005");
console.log(isValid); // true
Python (re)
import re

pattern = r"^3[47][0-9]{13}$"
match = re.match(pattern, "378282246310005")
print(bool(match)) # True
Go (regexp)
package main
import (
  "fmt"
  "regexp"
)

func main() {
  re := regexp.MustCompile(`^3[47][0-9]{13}$`)
  fmt.Println(re.MatchString("378282246310005"))
}
Frequently Asked Questions

Frequently Asked Questions

Everything you need to know regarding specifications, syntax, and security best practices.

The regular expression pattern is /^3[47][0-9]{13}$/. Validates 15-digit American Express credit cards starting with prefixes 34 or 37.