Regex Tester — Test Regular Expressions

Test regular expressions with live match highlighting, capture groups and explanations. Supports JavaScript flags: global, case-insensitive and multiline.

Highlighted matches
Capture groups
—

Regex cheat sheet

About Regex Visualizer

A regular expression (regex) is a compact pattern language for describing text: character classes, quantifiers, anchors, alternation, and capture groups combine to match everything from email addresses to log lines. This visualizer runs your pattern against sample input, highlights every match, and shows what each capture group captured so you can see exactly how the engine interprets the pattern.

Reach for regex when you need text validation, log parsing, extraction, or search-and-replace in scripts and code. Be careful with greedy quantifiers like .* which consume as much as possible — add ? to make them lazy when needed. Also mind the risks: patterns with nested quantifiers can cause catastrophic backtracking (ReDoS) on untrusted input, and different engines differ in features, so a pattern using lookaheads or backreferences may work in PCRE or JavaScript but not in RE2, Go, or MySQL.

Reading a pattern before you write one

A regular expression is read left to right, and each token consumes input or groups it. `\d` is one digit, `\w` is a word character, `.` is any character except a newline, and a quantifier such as `+` or `{3,}` applies to the token immediately before it. Getting that last relationship right is most of the difficulty in writing patterns.

Anchors change the scope of the match rather than what it matches: `^` requires the start of the string (or line, with the multiline flag) and `$` the end. For validation, an unanchored pattern that matches part of a string is almost never what you want.

Greediness and backtracking

A quantifier is greedy by default — `.*` consumes as much as possible and then gives characters back when the rest of the pattern fails. When results are longer than expected, that backtracking is usually the cause, and `.*?` is the first thing to try.

Nested quantifiers such as `(a+)+` can trigger catastrophic backtracking on non-matching input, freezing the page for seconds or minutes. If a pattern is slow rather than wrong, look for nested repetition first.

Flavours are not interchangeable

JavaScript, Python and PCRE agree on the basics and disagree on the edges: `\d` excludes some Unicode digits in some flavours, lookbehind support varies, and named group syntax differs. Test a pattern in the engine that will actually run it.

Frequently Asked Questions

How do I test a regular expression online?
Enter your regex pattern in the top input and your test string below. Matches are highlighted in real time as you type. The tool supports JavaScript-compatible regex syntax with flags like g (global), i (case-insensitive), and m (multiline).
Why is my regex not matching?
Check that you are using the correct syntax for JavaScript regex. Escape special characters with a backslash. For example, use \d instead of [0-9] shorthand classes, and escape dots as \. to match literal periods. Hover over the pattern error indicator for specific feedback.
Can I test regex against multiple strings at once?
Yes. Enter one or more test strings separated by newlines. All matches across all lines are highlighted simultaneously, with match groups shown for each occurrence.
Is my data sent to a server?
No. Every tool on jsonversal runs entirely in your browser using the Web Crypto API, File API, and Clipboard API. Nothing is ever uploaded — not even the JSON you paste in.
Do I need an account or API key?
No signup, no email, no API key. All tools are free to use with no signup required.
Can I use these tools offline?
Yes. Once the page loads, all tools work offline. There are no external API calls or CDN dependencies at runtime.
🔒
Your data never leaves your device

All processing happens in your browser. No uploads, no tracking, no servers. Your API keys, configs, and private payloads stay private — 100% client-side.

esc
↑↓ navigate ↵ open esc close