Skip to main content
Regexflux

US Date Format (MM/DD/YYYY)

beginner

Matches dates in American MM/DD/YYYY format.

dateusamericanformat

Pattern

/(?:0[1-9]|1[0-2])/(?:0[1-9]|[12]\d|3[01])/\d{4}/g

Try It

0 of 7 strings matched

Explanation

Matches month (01-12), day (01-31), and 4-digit year separated by forward slashes in the US date format.

Test Strings

Matching

  • 01/15/2024
  • 12/31/2023
  • 06/30/1999

Non-matching

  • 13/01/2024
  • 00/15/2024
  • 1/5/2024
  • 2024-01-15

Language Compatibility

LanguageSupport
JSFull support
PYTHONFull support
JAVAFull support
PHPFull support
GOFull support

Code Snippets

const regex = /(?:0[1-9]|1[0-2])\/(?:0[1-9]|[12]\d|3[01])\/\d{4}/g;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);

Common Variations

Flexible separators

(?:0[1-9]|1[0-2])[/.-](?:0[1-9]|[12]\d|3[01])[/.-]\d{4}

Accepts slashes, dots, or hyphens

Related Patterns