Runs the pattern against the test string in your browser using JavaScript's RegExp engine. Returns the match count and every match with its character position. Nothing is sent to a server.
Updates automatically as you type.
Calculated in your browser; your inputs are not sent to us. Privacy
Calculation details
Planning estimate only, not financial, tax, or legal advice. Verify assumptions and current rules before making decisions.
This tool runs in your browser. Your calculator inputs and results are never transmitted to us or to ad/affiliate partners. Ads and sponsored links may set third-party cookies to serve and measure them, but they never receive your calculation values. If you explicitly save a scenario, its permitted fields stay in local browser storage until you clear them. See our Privacy Policy.
Use this result
Share the current inputs or ask ChatGPT to explain the calculation in context.
More options
What does this calculator estimate?
Regex tester: test regular expressions against sample text and see live matches, capture groups, and errors to debug patterns fast. Free, private, no signup.
Why does my regex match in one tool but not another?
Most mismatches come from flavor differences rather than a broken pattern. Lookbehind, named groups, and Unicode classes vary between engines, and some tools implicitly anchor patterns that others treat as search-anywhere. When a pattern behaves differently here than in your code, test the smallest failing piece first: paste a two-character sample and add complexity until the divergence appears. That isolates the unsupported construct in seconds.
What does greedy versus lazy matching change?
A greedy quantifier such as * or + consumes as much as it can before backtracking, so <.+> swallows an entire string of tags instead of stopping at the first one. Adding a question mark (<.+?>) makes it lazy and stops at the earliest possible match. When a capture returns more text than expected, laziness is usually the fix; when it returns too little, check for an accidental lazy marker or a missing anchor.
How this calculator works
Formula
Compile the pattern with the given flags using JavaScript's RegExp constructor, then iterate matches over the test string with exec(), collecting each match and its zero-based start index. A missing global 'g' flag returns only the first match; a match limit guards against runaway matches.
Worked example
For the pattern \b[A-Z]{2,}\b with flags gi against 'The USA and the UK use SHOUTING in TITLES.', the tool finds 9 matches (every word) and lists each with its position, showing how the case-insensitive flag changes the result.
Assumptions to verify
- The pattern is evaluated with JavaScript's RegExp engine, matching the syntax your browser supports.
- Flag letters are validated to g, i, m, s, u, and y.
- A match limit of 2,000 prevents catastrophic backtracking from freezing the page.
- When 'Escaped' mode is selected, literal \t and \n are converted to real tabs and newlines.
Frequently asked questions
Why does my pattern only return one match?
Add the g (global) flag. Without it, the engine returns only the first match in the string.
Does the tool send my pattern or text anywhere?
No. The regex runs entirely in your browser. Nothing you paste is transmitted or stored.
Which regex flavor does this use?
JavaScript's native RegExp engine — the same syntax used in browsers and Node. Lookbehinds and named groups depend on your browser's engine version.
My page froze on a huge pattern.
A built-in 2,000-match limit stops runaway matching. Very complex patterns can still be slow; try simplifying or anchoring the pattern.
Cite this tool
BoringToolsKit. “Regex Tester.” boringtoolskit.com/regex-tester/. Free to reference in articles, syllabi, and answer posts with a link.
Privacy: Inputs and results stay in this browser. Any future sponsored recommendation or advertisement will be clearly labeled and kept separate from the calculation.