YYYY-MM-DD format
Match a date in YYYY-MM-DD format. Check the shape only: 4 ASCII digits, hyphen, 2 digits, hyphen, 2 digits. Do not validate the calendar; 2024-99-99 matches.
Preview challenge → Free account required to solveJAVASCRIPT IN PRACTICE
Match the required strings and reject the others. Practice regular expressions with concrete examples.
Solving requires a free account.
Pick a challenge and explore the rules through a concrete example.
Match a date in YYYY-MM-DD format. Check the shape only: 4 ASCII digits, hyphen, 2 digits, hyphen, 2 digits. Do not validate the calendar; 2024-99-99 matches.
Preview challenge → Free account required to solveMatch an entire non-empty string containing only ASCII digits 0–9. No sign, whitespace or decimal separator.
Preview challenge → Free account required to solveMatch the entire simplified address: a non-empty local part using ASCII letters, digits and ._%+-, then a domain with alphanumeric labels (hyphens only inside), at least…
Preview challenge → Free account required to solveAvailable challenges: 7.
See all challenges →The full catalogue requires a free account.
Regular expression exercises teach you to recognise text formats and reject non-matching data. They are useful for filtering logs, searching text and checking the shape of form values. Matching a format does not always prove validity, such as whether a calendar date exists.
Compare strings that should match with those that must be rejected. Build a clear pattern expressing the difference first. Check start and end anchors, repetition counts and escaped characters. After each change, run every example, not just the last failing case.
Read the description without logging in. Solving requires a free account.