The Code Codex
Theme

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.
Parameters
Regular expression
BR Documents
Dev & Web
View
Flags
2 matches/(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/g
Highlighted matches
Release 2026-10-21 and LTS support until 2028-04-30.
#12026-10-21
Line 1:9 · Offset [8..18]
year:2026month:10day:21
#22028-04-30
Line 1:42 · Offset [41..51]
year: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=…
ParameterDescriptionDefault
pexpressão regular(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})
fflags: g, i, m, s, ug
modematch | replace | cheatsheetmatch
repltexto de substituição ($&, $1, $<nome>)$<day>/$<month>/$<year>
texttexto de testeRelease 2026-10-21 and LTS support until 2028-04-30.
langpt | enpt

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.

More in Development