.*
Developer/Regex Tester

Regex Tester

Test regular expressions with live match highlighting and group capture.

LIVE MATCHLive highlightCapture groupsAll flagsError display
Pattern
//
Test Text
Highlighted Preview
The Quick Brown Fox Jumps Over The Lazy Dog
Matches (9)
"The" @ index 0
"Quick" @ index 4
"Brown" @ index 10
"Fox" @ index 16
"Jumps" @ index 20
"Over" @ index 26
"The" @ index 31
"Lazy" @ index 35
"Dog" @ index 40
Data Source & Legal Disclaimer
Effective: 2026
Sources: Browser-side processing (no external API)

This tool runs 100% in your browser. All computation happens locally on your device — your input is never uploaded to any server. Results are for reference only.

See all data sources & update policy →

How a pattern walks through your text — illustrated

A regular expression is a tiny state machine: the engine starts at the left, tries to match the pattern, and on success records a match then resumes just after it. Flags change the walk — g keeps scanning, i relaxes case, m re-anchors ^/$ to each line. Capturing groups (…) store sub-parts so you can pull out just the fraction of each hit.

Match → advance → repeat
A1B22C333← cursor never goes backMatch 1 → “1” at index 1Match 2 → “22” at index 3Match 3 → “333” at index 6With /g it records all three. Without it, only “1”.

Pattern /\d+/g against the string 'A1B22C333': the engine finds 1, resumes after it, finds 22, resumes, finds 333. Without the /g flag it stops after the first hit.

From vague to precise — three patterns

Same sandwich description, three extraction goals.

  1. Goal: any digits:/d+/g → catches 12 and 34 in “Order #12 · qty 34”
  2. Goal: a price:/\$\d+\.\d{2}/ → matches “9.99” and “19.50” only when dollar-prefixed
  3. Goal: an email-like id:/[a-z]+\d+/gi → case-insensitive run of letters then digits
  4. Trap to watch:Metacharacters must be escaped — a literal “.” needs \., or it matches any character
↩ Back to tester

About this tool

What is this tool?

Test regular expressions with match highlighting, capture group display, and all standard flags (g, i, m, s, u, y). 100% in-browser, free.

Live highlightCapture groupsAll flagsError display

What Is the Regex Tester?

This tester is a live workbench for regular expressions: type a pattern and sample text, and every match highlights in place as you type. Beyond matching, it exposes the machinery developers actually need to debug patterns — numbered capture groups with their extracted values, all standard flags including global, case-insensitive, multiline, and dotall, and clear errors when the pattern fails to compile. Named groups render with their labels, and match counts update live, so you can tighten a pattern against real data instead of guessing whether it works.

Who Should Use This Tool?

Developers building validation rules for forms and APIs confirm a pattern accepts every valid input and rejects the invalid before shipping it. Data engineers writing extraction patterns for logs and text pull the capture groups they named straight from the panel. Anyone maintaining legacy regex — often the most feared code in a repository — pastes it here with representative input to understand what it actually matches before touching it. QA engineers construct boundary-case strings that expose greedy-versus-lazy and anchor mistakes before production does.

How Does It Work?

(1) Enter your pattern; compile errors show immediately with position hints. (2) Toggle flags — g for all matches, i for case-insensitivity, m for ^ and $ per line, s so dot matches newlines, plus u and y. (3) Paste sample text into the subject area; matches highlight live and the count updates. (4) Inspect results: each match with its index, and every capture group — numbered and named — with extracted text and a quick null check for optional groups that did not participate. Patterns and text stay local to your browser.

What Are the Most Common Regex Mistakes?

Five patterns of failure account for most regex bugs. Greedy quantifiers swallowing too much: .* in <.*> consumes to the last > on the line — switch to lazy .*? or use negated classes like [^>]*. Unescaped special characters: a literal dot must be \. or it matches any character, the classic email-validation leak. Missing anchors: ^\d{4} without ^ matches the last four digits anywhere — decide whether substring matching is intended. Catastrophic backtracking: nested quantifiers like (a+)+ against long non-matching input hang engines — unroll the pattern or add atomic-style possessive behavior where supported. And platform drift: lookbehind, named groups, and Unicode property escapes vary across engines, so test against the flavor you ship to. This tester runs the JavaScript flavor, which matches browser and Node environments exactly.

Frequently Asked Questions

Which regex flags and engine does this tool support?

It uses the JavaScript RegExp engine with all standard flags: g (global), i (case-insensitive), m (multiline), s (dotall), u (unicode), and y (sticky). Live match highlighting shows all matches simultaneously. Capture groups are displayed in a numbered list below the match results for easy debugging.

Can I test regex patterns against multiline text?

Yes. Enable the m flag for multiline mode (^ and $ match line boundaries) or the s flag for dotall mode (. matches newlines). This is essential for parsing log files, extracting data from structured text, and validating multiline form input. All processing is 100% in-browser.

Related tools

Joke of the Day
Sep 6

What do you call a crab that plays baseball?

100% Free, Forever

Keep Tools Free for Everyone

No paywalls, no signups, no data sold. Built by a solo developer who believes useful tools should be accessible to everyone.

Support me on Ko-fi— keep tools free

100% of proceeds go towards hosting & building more free tools.