Test Regular Expressions Live with Match Inspection
Test regular expressions live against your text, see each match with its index, and toggle flags.
- No upload
- No signup
- Free
Loading tool…
Your file stays in this browser. Nothing is uploaded.
Loading tool…
Your file stays in this browser. Nothing is uploaded.
How Regex Tester & Debugger works
Browser Toolset Regex Tester evaluates regular expressions in real time using the browser JavaScript RegExp engine. List every match with its index and toggle the g, i, m and s flags client-side. Your text is not uploaded.
How to use this tool
- Enter your regular expression pattern between the forward slashes.
- Toggle regex flags (g = global, i = case-insensitive, m = multi-line, s = dotAll).
- Type or paste your test string into the text area.
- Review the list of matches, each with its index, as you type.
- Check the short list of common tokens under the results for syntax hints.
Common uses
- Developers building form validation patterns for emails, phone numbers, and passwords.
- Data analysts extracting structured data from unstructured server logs.
- Software engineers debugging complex string parsing logic.
- Students learning regular expression syntax and token meanings.
Frequently asked questions
Which regex engine does this tester use?
It uses the JavaScript RegExp engine built into your browser, so results match what JavaScript code in that browser would produce. Syntax from other engines, such as PCRE-only or Python-only features, may behave differently or be rejected.
Are my sensitive test strings or regex patterns uploaded?
No. Patterns and test strings are evaluated in a background worker in your browser and are not uploaded. The text stays on the page only until you clear or reload it, and nothing is saved by the tool.
Does it support named capture groups?
Named groups are valid in the pattern because the browser's JavaScript engine supports them, but the results list shows only each full match and its index. Individual capture groups and their names are not listed separately.
Can I test multi-line patterns?
Yes. Turn on the m flag so ^ and $ match at the start and end of each line, and the s flag so a dot also matches line breaks. The test box accepts multiple lines of text.
Does it protect against catastrophic backtracking (ReDoS)?
It limits the damage. Each pattern runs in a background worker with a 1.5 second timeout, and a pattern that takes longer is stopped with a message to simplify it. Test strings over 200,000 characters are not run live.
Details and limits
Regular expressions are among the most powerful tools in a developer's toolkit, but their concise syntax can be notoriously tricky to debug. Our in-browser Regex Tester provides instant feedback, a short token reference, and a list of matches with their positions without sending your test strings to a server.
How matching runs
Patterns are executed by your browser's JavaScript regular expression engine, so the syntax is JavaScript's. Character classes such as \d, \w and \s, lookahead, lookbehind in current browsers and named groups all work. Features specific to other flavors, such as possessive quantifiers and atomic groups, do not.
Matching runs in a background worker with a 1.5 second limit. If a pattern is too slow, for example one with nested repeats like (a+)+, the page stays responsive and shows a message asking you to simplify it. Your pattern and test text stay in the browser.
Features and limits
- Four flag toggles: g finds every match, i ignores case, m makes ^ and $ work per line, and s lets the dot match line breaks. Without g only the first match is returned. Flags such as u and y are not available.
- The results list shows the full text of each match and its starting index. Copy Matches copies the matched text, one per line.
- Capture groups and named groups work inside the pattern, but their individual contents are not broken out in the results list.
- Live matching is limited to 200,000 characters of test text, and a global search stops listing after 500 matches.
- Invalid patterns show the browser's error message under the pattern box. The tool finds matches only; for replacing text, use the Find and Replace Text tool.
Tips for best results
Build a pattern gradually. Start with a plain literal, add one token at a time and watch the match count change. Type the pattern without surrounding slashes, because the tool already shows them.
- Escape the dot. An unescaped . matches any character, so use \. for a literal full stop.
- Forgetting the g flag is the most common reason only one match appears.
- Use m when ^ and $ should match at the start and end of each line.
- Greedy quantifiers such as .* take as much as possible. Use .*? to stop at the first possible end.
- Patterns that can match nothing, such as a*, produce empty matches. The tool steps past them so it does not loop.
- The default email pattern is a quick filter, not a full validator.