DD
DevDash

Regex for Date DD/MM/YYYY

Regex Pattern

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

European date format with slashes

Quick Answer

The regex pattern for date dd/mm/yyyy is `^(0[1-9]|[12]\d|3[01])\/(0[1-9]|1[0-2])\/\d{4}$`. European date format with slashes. This works in JavaScript, Python, Ruby, PHP, Java, and most regex engines that support PCRE syntax.

Test Examples

InputResult
11/04/2026✓ Matches
01/01/2000✓ Matches
31/12/1999✓ Matches
4/11/2026✗ No match
2026-04-11✗ No match
32/01/2026✗ No match

Code Examples

javascript

const regex = /^(0[1-9]|[12]\d|3[01])\\/(0[1-9]|1[0-2])\\/\d{4}$/;
const isValid = regex.test(value);

python

import re
pattern = r'^(0[1-9]|[12]\d|3[01])\/(0[1-9]|1[0-2])\/\d{4}$'
if re.match(pattern, value):
    print("valid")

ruby

pattern = /^(0[1-9]|[12]\d|3[01])\/(0[1-9]|1[0-2])\/\d{4}$/
if value =~ pattern
  puts "valid"
end

php

if (preg_match('/^(0[1-9]|[12]\d|3[01])\\/(0[1-9]|1[0-2])\\/\d{4}$/', $value)) {
    echo "valid";
}

java

String pattern = "^(0[1-9]|[12]\\d|3[01])\\/(0[1-9]|1[0-2])\\/\\d{4}$";
boolean isValid = value.matches(pattern);

Frequently Asked Questions

Related Regex Patterns

Want API access + no ads? Pro coming soon.