US Date Format (MM/DD/YYYY)
beginnerMatches dates in American MM/DD/YYYY format.
dateusamericanformat
Pattern
/(?:0[1-9]|1[0-2])/(?:0[1-9]|[12]\d|3[01])/\d{4}/gTry 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
| Language | Support |
|---|---|
| JS | Full support |
| PYTHON | Full support |
| JAVA | Full support |
| PHP | Full support |
| GO | Full 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