Regex Toolkit
Test patterns with live match highlighting and browse a library of common regexes.
- regex
- regexp
- pattern
- match
- test
- library
About Regex Toolkit
Regular expressions are concise, but they're also famously easy to get wrong. The Regex Toolkit gives you a fast feedback loop: type a pattern, paste a test string, and see every match highlighted in place along with the captured groups for each one. No "run" button — every keystroke updates the result.
Alongside the tester, the toolkit includes a curated library of common patterns (emails, URLs, IP addresses, phone numbers, dates, and more), a plain-English explainer that breaks a pattern down token by token, and a converter that translates between regex flavours — JavaScript, PCRE, Python, Java, .NET, and Go's RE2 — so a pattern written for one engine can be ported to another.
How to use
Type your pattern into the "Pattern" field (no leading or trailing slashes — flags are checkboxes underneath). Toggle the g, i, m, s, u, and y flags to match your target engine's defaults. Paste sample text into the "Test string" field and watch matches highlight live; the matches panel below lists every match, its index, and any capture groups.
Switch to the "Explainer" tab to read your pattern in plain English, or to the "Converter" tab to translate it between regex flavours. The "Library" tab is a quick way to grab a vetted pattern for a common job instead of writing one from scratch.
Frequently asked questions
What's the difference between the regex flavours?
They differ in exact syntax and feature set. JavaScript and Java/PCRE are similar but Java has different escaping rules; Python's re module lacks some PCRE features but adds others; .NET supports balancing groups; Go's RE2 deliberately omits backreferences and lookaround to guarantee linear-time matching. The Converter tab translates patterns where possible and flags constructs that don't have a direct equivalent.
What does each regex flag do?
g (global) finds all matches, not just the first. i (insensitive) ignores case. m (multiline) makes ^ and $ match line boundaries instead of just the start/end of the whole string. s (dotall) lets . match newlines. u (unicode) enables proper Unicode handling. y (sticky) anchors each match to the lastIndex position. Tick the boxes to match the target engine's defaults.
Why is my pattern so slow on long inputs?
Almost certainly catastrophic backtracking. Patterns like (a+)+ or (a|a)* can make the regex engine explore an exponential number of paths on certain inputs. The fix is usually to make quantifiers possessive, use atomic groups, or restructure the pattern so it never has two ways to match the same prefix. The Library has examples of fast alternatives for common jobs.
Where do the named-pattern Library entries come from?
They're hand-curated common patterns — email, URL, IPv4, IPv6, phone numbers, dates, hex colours, etc. — chosen to match real-world data without being so strict they reject valid input. They're a sensible starting point, but always test against your actual data before relying on one in production code.
More Text & Encoding tools
JSON Formatter
Pretty-print, validate, or minify JSON with helpful error positions.
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to text. UTF-8 safe.
URL Encoder / Decoder
Percent-encode or decode URLs and query parameters.
JWT Decoder
Decode a JSON Web Token to inspect its header and payload.