Test regular expressions with live match highlighting
g — Global — find all matches, not just the firsti — Case-insensitive — ignore uppercase/lowercasem — Multiline — ^ and $ match the start/end of each line, not just the whole texts — Dotall — . also matches newline charactersMore on regex flags and syntax in the FAQs below.
Highlighted matches
hello@example.comat index 14helloGroup 2: example.comsupport@test.orgat index 35supportGroup 2: test.orgEnter your pattern
Type a regular expression.
Set flags
Toggle g, i, m, and s as needed.
Paste test text
See every match highlighted, with capture groups listed below.
Write a regular expression, paste in test text, and see every match highlighted live — with both numbered and named capture groups broken out per match, and clear error messages the moment a pattern is invalid. Toggle g, i, m, and s flags to control global matching, case sensitivity, multiline anchors, and whether . matches newlines. One-click presets for common patterns — email, URL, IPv4, phone, hex color — load a working pattern, sensible flags, and sample text instantly, without typing one from scratch. Beyond just testing, switch on Replace to see exactly what a find-and-replace would produce — using $1, $2 for numbered groups or $<name> for named ones — before running it anywhere for real. Everything runs on JavaScript's native regex engine, entirely in your browser, so nothing you type or test is ever sent anywhere.
g (global) finds every match in the text instead of stopping at the first. i (case-insensitive) ignores uppercase/lowercase differences. m (multiline) makes ^ and $ match the start/end of each line rather than only the very start/end of the whole text. s (dotall) makes . also match newline characters, which it skips by default.
The pattern isn't valid JavaScript regex syntax — the exact error message from the engine is shown to help pinpoint the issue.
Yes — click "Replace matches with..." below the match list, type a replacement using $1, $2 for numbered capture groups or $<name> for named ones, and see the result update live.
Yes — a pattern like (?<user>\w+)@(?<domain>\w+\.\w+) shows both the numbered groups and the named user/domain values separately for every match, and $<user>/$<domain> both work in a replacement string.
JavaScript's native RegExp engine, since everything runs in your browser. Most everyday patterns behave the same across JavaScript, PCRE, and Python, but some advanced features, like PCRE's recursive patterns, aren't part of JavaScript's regex syntax.
The most common causes: a missing g flag when you expected multiple matches, case sensitivity when i wasn't enabled, or a special character (like . or *) that needs escaping with a backslash to be matched literally instead of as regex syntax.
The plain form ( .* ) is greedy — it matches as much as possible, then backs off only if needed. Adding a ? ( .*? ) makes it lazy — it matches as little as possible, which usually gives a tighter, more intuitive result when there are multiple possible matches in the same string.
Wrapping part of a pattern in parentheses both captures that specific piece of the match for later use (in a replacement, or in code) and lets you apply quantifiers to the whole group at once, instead of just the character right before them.
When you need parentheses purely for grouping or applying a quantifier, without wanting that piece to show up in the results — it keeps group numbering cleaner when a pattern has several grouped pieces but you only care about some of them.
^ anchors to the start of the string (or each line, with the m flag) — a position, not a character. \b matches a word boundary, the transition between a word character and a non-word character, which is why \bcat\b matches "cat" but not "category".
Yes — paste multi-line text into the test string box, and enable the m flag if you want ^ and $ to match the start/end of each line rather than only the very start and end of the whole text.
No — everything resets when you leave or refresh the page; nothing is stored here or sent anywhere while you work.
A lookahead — (?=...) for positive, (?!...) for negative — checks what comes next without including it in the match itself. JavaScript's regex engine, which this tool uses, supports both, along with lookbehind ((?<=...) and (?<!...)).
Check that the g flag is enabled — without it, both matching and replacing stop after the first result, even if there are others further in the text.
Yes — click any of the Common patterns buttons (Email, URL, IPv4, Phone, Hex color) above the pattern field to instantly load a working pattern, sensible flags, and matching sample text.
No single short regex does — the presets are solid, practical starting points that match realistic everyday input, not exhaustive spec-compliant validators. Adjust them for stricter or looser matching based on what you actually need to accept.
Convert YAML to JSON or JSON to YAML instantly, in either direction, with clear parse-error messages. All conversion happens in your browser.
Generate placeholder Lorem Ipsum text by paragraphs, sentences, or words. Copy or download instantly. All generation happens in your browser.
Comprehensive text processing tool: count characters, words, lines, sentences, and paragraphs; convert case across 7 styles (UPPERCASE, lowercase, Title Case, Sentence case, camelCase, snake_case, kebab-case); find & replace with case-sensitive and whole-word matching plus a live match counter; and remove extra spaces. Copy or download the result. All processing done locally in your browser — nothing is uploaded.
Compare two texts side-by-side with color-coded highlighting for additions, deletions, and modifications. Supports line-by-line, word-level, and character-level comparison modes. Perfect for code review, document comparison, and tracking changes.