Regex Tester & Presets
Data, Regex & TextLive Regex tester with presets, side-by-side Diff checker, case/slug tools, and GFM Markdown builder.
100% client-side — files and inputs never leave your browser.
Av. Paulista: [CEP:01310-100] | Praça da Sé: [CEP:01001000]
About this tool and how it works
Testing regular expressions live
Type a pattern and sample text and every match is highlighted as you type, with capture groups listed per match and a replace preview that supports $1-style backreferences. The engine is your browser's JavaScript RegExp, so what matches here matches in Node.js, Deno, and front-end code.
Flags
g— find all matches instead of stopping at the first.i— case-insensitive.m—^and$match at each line, not just the start and end of the text.s—.also matches newlines.u— full Unicode mode, needed for\p{L}and emoji-aware matching.
Presets
Start from tested patterns for email, URL, IPv4, UUID, ISO dates, and Brazilian formats (CPF, CNPJ including the 2026 alphanumeric format, CEP, phone numbers, DD/MM/YYYY dates). Presets match the shape of a value; check digits for CPF/CNPJ still need validation in code.
Writing safer patterns
- Anchor validators with
^…$, otherwise\d{5}also matches inside123456789. - Prefer specific classes (
[^"]*) over.*to avoid greedy over-matching. - Avoid nested quantifiers such as
(a+)+; on some inputs they cause catastrophic backtracking (ReDoS) and can freeze a server. - Use named groups —
(?<year>\d{4})— so code readsmatch.groups.yearinstead of magic indexes.
Frequently asked questions
Will a pattern tested here work in Python or Java?
Basic syntax is shared, but flavors differ: lookbehind, named-group syntax, and Unicode classes vary. This tester uses JavaScript semantics, so re-test in the target language for edge cases.
Why does my pattern only find the first match?
Add the g (global) flag. Without it, JavaScript stops after the first match.
Does the CPF preset check if a CPF is real?
No. A regex only checks the format. Validating the two check digits requires a small calculation, which our CPF generator and validator tool performs.
Other tools
Beautify, minify, validate with line errors, sort keys, and inspect JSONPath.
Convert bidirectionally between JSON, YAML, CSV, and TOML in your browser.
Generate TypeScript interfaces and Zod schemas from any JSON payload.
Beautify or minify SQL queries (Postgres/MySQL), XML, and HTML markup.
Compare text, JSON, or code side-by-side or in unified diff view.
Convert camelCase/snake_case/slugs, count bytes/words, and deduplicate lines.
Live GFM preview, HTML export, and Markdown table generator from CSV/TSV.
Create direct wa.me links with pre-filled messages and downloadable PNG QR codes.
Merge, split, compress, rotate pages, and convert between PDF and images 100% locally.