Launching a SaaS?·Collect waitlist signups before you build — before.run
SandboxPatternsDetectDocsChangelog
Date & Time
#date
#iso
#time
#datetime

ISO 8601 Date

ISO 8601 date format (YYYY-MM-DD) with month and day range validation.

✓ API date field validation✓ Database date input parsing✓ Log timestamp parsing
/
/
Safe
Test String
3 matches
\d{4}digit— \d — digit (0–9) — repeated exactly 4 times · {4} — exactly 4 times
--— '-' — literal character
(?:…)Non-capturing group— Non-capturing group — groups without capturing (no index assigned)
00— '0' — literal character
[…]Character class […]— Matches any single character listed in this set
||— | — alternation: matches expression on left OR right
11— '1' — literal character
[…]Character class […]— Matches any single character listed in this set
--— '-' — literal character
(?:…)Non-capturing group— Non-capturing group — groups without capturing (no index assigned)
00— '0' — literal character
[…]Character class […]— Matches any single character listed in this set
||— | — alternation: matches expression on left OR right
[…]Character class […]— Matches any single character listed in this set
\ddigit— \d — digit (0–9)
||— | — alternation: matches expression on left OR right
33— '3' — literal character
[…]Character class […]— Matches any single character listed in this set
Pattern: 47 charsInput: 32 chars
100% client-side · private

✓ Valid Examples

  • 2024-01-15
  • 1999-12-31
  • 2000-02-29

✗ Invalid Examples

  • 2024-13-01
  • 01-01-2024
  • 2024/01/15
  • 20240115

Usage & Integration

Validate ISO 8601 Date natively in your backend or frontend without copying regex strings.

Node / Edge

import { validate } from '@regexto/validators';

validate('iso-date', '...');

Python

from regexto_validators import validate

validate("iso-date", "...")

Go

import "github.com/regex-to/validators-go"

valid, err := validators.Validate("iso-date", "...")

PHP

use RegexTo\Validators\Validator;

Validator::validate('iso-date', '...');

Rust

use regexto_validators::validate;

let is_valid = validate("iso-date", "...").unwrap();