Regular expression visualizer
Visualize regular expressions as railroad diagrams — modern syntax, live preview.
/
/
Explanation
(?<year>\d{4})capturing group #1 (named "year"):\d{4}repeated exactly 4 times:\da digit (0-9)-the character "-"(?<month>\d{2})capturing group #2 (named "month"):\d{2}repeated exactly 2 times:\da digit (0-9)-the character "-"(?<day>\d{2})capturing group #3 (named "day"):\d{2}repeated exactly 2 times:\da digit (0-9)
Test strings
/(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/.test(str)
JS code
const re = /(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/
if (re.test(str)) {
// matched
}Examples