Regex for ISO dates (YYYY-MM-DD)
Example pattern below—edit it or paste your own. All processing runs in your browser. For Python’s re module, switch flavor in the tool.
Standard `RegExp` for explanation and preview.
Plain-English explanation
Flavor: JavaScript RegExp
Flags: g (find all matches)
a word boundary Then Match digit character (0–9), repeated exactly 4 times. Then Match the character "-". Then Match one of: (1) Match the character "0". Then Match one character from: characters from the character "1" to the character "9". OR (2) Match the character "1". Then Match one character from: characters from the character "0" to the character "2". Then Match the character "-". Then Match one of: (1) Match the character "0". Then Match one character from: characters from the character "1" to the character "9". OR (2) Match one character from: the character "1", the character "2". Then Match digit character (0–9). OR (3) Match the character "3". Then Match one character from: the character "0", the character "1". Then a word boundary