MM/DD/YYYY regex pattern

Copy and test a JavaScript regex for MM/DD/YYYY dates, with examples, limitations, and a one-click link to the regex tester.

MM/DD/YYYY regex pattern

Validate whole value

Use anchors to check whether the complete value matches.

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

Flags: -

Search in text

Find matching fragments inside a larger block of text.

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

Flags: g

Examples that match

  • 12/31/2026
  • 01/05/2027

Examples that do not match

  • 31/12/2026
  • 2026-12-31

Limitations

This pattern matches date-like strings in MM/DD/YYYY form. Use date parsing for real calendar validation.