Regex Tester & Replacer
Test regular expressions in real time with match highlighting, ready-made validation patterns, named capture groups, and live replacement.
The link keeps what is on screen.
2 matches
/(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/gHighlighted matches
Release 2026-10-21 and LTS support until 2028-04-30.
#1
Line 1:9 · Offset [8..18]2026-10-21year:2026month:10day:21
#2
Line 1:42 · Offset [41..51]2028-04-30year:2028month:04day:30
Tokens detected in pattern
- (?<year>
- Named capture group (?<name>…)
- (?<month>
- Named capture group (?<name>…)
- (?<day>
- Named capture group (?<name>…)
- \d
- Digit character [0-9]
- {4}
- Exact or range repetition quantifier {n,m}
- {2}
- Exact or range repetition quantifier {n,m}
- ?
- Optional (0 or 1 time) or lazy quantifier
How is it calculated?
Compiles the pattern with JavaScript's native RegExp engine (ECMA-262) using the chosen flags. Includes named-group expressions for Brazilian documents (CPF with tax region, numeric & alphanumeric CNPJ per IN RFB 2.229/2024, 44-digit NF-e/NFC-e/CT-e access keys, CEP, phone, and Mercosul plates) and developer formats (Email, UUID v4/v7, JWT, SemVer, IPv4, and URL).
See the code ↗Processed in your browser; nothing is sent.
⌨️ Use from the terminal (JSON)
This tool also runs outside the site: the cli.js script uses the same logic as this page and returns the result as JSON. Parameters are the same as this page's URL — copy the command below with the values on screen.
Deno
deno run -q "https://thecodecodex.com/cli.js?tool=regex"
Node.js / Bun
curl -s https://thecodecodex.com/cli.js | node --input-type=module - regex p=…
| Parameter | Description | Default |
|---|---|---|
| p | expressão regular | (?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2}) |
| f | flags: g, i, m, s, u | g |
| mode | match | replace | cheatsheet | match |
| repl | texto de substituição ($&, $1, $<nome>) | $<day>/$<month>/$<year> |
| text | texto de teste | Release 2026-10-21 and LTS support until 2028-04-30. |
| lang | pt | en | pt |
Requires Deno, Node.js or Bun. With Deno the script runs with no permissions: it cannot read files or access the network. Central Bank indicators are from the day the site was published.