Regex Tester
Test JavaScript regular expressions with live match highlighting, flags and capture groups.
Contact us at hello@toolsink.com or press@toolsink.com.
- #1 [14–32] “hello@toolsink.com”groups: $1=“hello”$2=“toolsink.com”
- #2 [36–54] “press@toolsink.com”groups: $1=“press”$2=“toolsink.com”
About Regex Tester
The Regex Tester runs your regular expression against sample text as you type, highlighting matches and listing capture groups in real time. It uses the JavaScript (ECMAScript) regex engine, so patterns behave exactly as they will in browsers and Node.js.
Flags can change matching substantially: global finds repeated matches, case-insensitive ignores letter case, multiline changes anchor behavior, and dotAll allows a dot to cross line breaks. Seeing those effects against representative text is safer than reasoning about a complex pattern in isolation.
Both the pattern and the sample text stay in your browser — nothing is uploaded. That privacy matters when the sample includes emails, order IDs or internal log lines you would rather not paste into a cloud sandbox.
A good test set includes happy-path strings, near-misses and empty input. Patterns that look correct against one example often over-match or under-match once you feed them messy real data.
How Regex Tester works in practice
- 1Type your regular expression into the pattern box.
- 2Add flags (g for global, i for case-insensitive, m for multi-line, s for dotAll).
- 3Paste your target text into the sample area.
- 4Watch matches highlight as you type — capture groups appear underneath.
- 5Iterate on the pattern until both intended hits and intentional non-matches behave correctly.
Jobs this tool is built for
- Test a client-side form-validation pattern against valid and invalid examples.
- Develop capture groups for extracting dates, identifiers or fields from log lines.
- Confirm how `g`, `i`, `m` or `s` flags affect a JavaScript replacement operation.
- Reproduce a browser or Node.js regex bug using the exact input that triggered it.
- Compare a proposed email or URL pattern against a short list of edge-case strings before shipping.
What you can do here
- Live match highlighting as you type
- Capture-group inspector
- All standard JavaScript flags (g, i, m, s, u, y)
- Handles multi-line sample text
- Browser-only — patterns and samples are not uploaded
Limits and honest caveats
- Catastrophic backtracking can freeze the tab on pathological patterns and long inputs — keep samples realistic and avoid nested unbounded quantifiers when possible.
- This tester mirrors JavaScript behaviour; other languages may differ on lookbehinds, named groups and Unicode property escapes.
- Patterns and sample text are kept only for the current tab — refreshing clears the state.
Common questions about Regex Tester
Which regex flavour does the tool use?
JavaScript's ECMAScript engine, so patterns transfer directly to browser and Node.js code.
How do I test a Python regex?
Most patterns are compatible, but Python-only syntax such as `(?P<name>...)` named groups differs — test those in Python.
Does the tool save my patterns?
Only in the current tab. Refreshing the page clears the state.
Why does `^` not match the start of every line?
Enable the `m` multiline flag. Without it, `^` and `$` refer to the start and end of the entire input rather than each line.
Why did the page become unresponsive?
Some patterns with nested quantifiers can take exponential time. Simplify the expression or shorten the sample text, then retry.
Do capture groups show nested matches?
Yes — numbered groups from the latest match are listed so you can see what a replacement template or parser would receive, including optional groups that came back empty.
This page was written by the ToolSink team to explain how Regex Tester works on this site — it is not syndicated, scraped, or spun from another publisher. How we write tool guides · Site updates · About ToolSink.
All Developer Tools
Tap any tool to jump straight in — no signup, works on mobile.