Regex tester
Test a bounded regular expression against local text, inspect match offsets and captures, then export the report.
How it works & useful details
Find matches with guardrails
Enter a JavaScript-style pattern and optional g, i, m, s, or u flags. The explorer scans local test text and lets you inspect captured groups and character offsets.
For predictable browser responsiveness, lookarounds, backreferences, repeated alternatives, and repeated groups containing repetitions are refused. A refusal is not a security verdict for any pattern; use a dedicated runtime policy for untrusted regular expressions.
Private, bounded text processing
Code and markup stay as inert text in this browser. These tools do not execute JavaScript, render HTML, load URLs, install packages, contact registries, or save what you paste.
Regex patterns are limited to 500 characters and test text to 20,000 characters. Formatters and package inspection accept up to 100,000 characters; exports are capped at 200,000 characters.
About this tool
Regex tester runs a bounded pattern against local text and shows every match with its offsets and captured groups. It helps you confirm that a pattern behaves as intended before you use it in code, a search, or a replace step.
The pattern runs in your browser only, and the test text never leaves the page. Matches are reported with positions so you can understand exactly where the engine found them.
How to use it
- Enter the regular expression and choose the flags you need.
- Paste the text to test against.
- Review the match list, offsets, and captured groups.
- Export the report for your notes or a code review.
Worked example
The pattern \b[A-Z][a-z]+\b with the g flag, run against "Ada wrote Toolbox with Grace.", finds three matches:
1. [0–3] "Ada"
2. [10–17] "Toolbox"
3. [23–28] "Grace"The numbers are start and end offsets, so you can see exactly which characters each match covers. \b keeps matches to whole words, and "wrote" is skipped because it starts with a lowercase letter.
Flags
- g: find all matches instead of only the first.
- i: ignore letter case.
- m: make ^ and $ match at every line start and end, not only at the start and end of the whole text.
- s: let . match line breaks too.
- u: Unicode mode, needed for \p{L} property escapes and for handling emoji as single characters.
Some constructs are refused on purpose: lookarounds, backreferences, and nested repetition such as (a+)+. Nested repetition can cause catastrophic backtracking, where a short input makes the regex engine run for minutes. Refusing these keeps the page responsive. If your production code must accept patterns like that from users, protect it with a time limit or a linear-time engine such as RE2.
Frequently asked questions
What happens with catastrophic backtracking?
The tool is bounded and reports when matching is refused or takes too long, rather than locking your browser.
Are lookarounds and named groups supported?
Patterns use JavaScript regular-expression semantics, so features supported by the browser engine work; unsupported syntax is reported.
What are the limits?
Patterns are limited to 500 characters and test text to 20,000 characters.
Is this the same regex flavour as Python or PCRE?
It follows JavaScript syntax. Most everyday patterns behave the same in Python, PCRE, and Java, but features like possessive quantifiers and some escapes differ.
