The Regex Tester lets you check a regular expression against real text and instantly see exactly what it matches. You enter your pattern and any flags, paste the text you want to test, and the tool runs the expression and lists every match along with the position where it starts and the contents of any capture groups. It turns the usual trial-and-error of writing a pattern into a fast, visible feedback loop.
Regular expressions are compact but unforgiving, and a small mistake can mean your pattern matches too much, too little, or nothing at all. By showing each match with its index and groups in a clear table, this tester helps you confirm that a pattern behaves the way you intend before you drop it into code, a find-and-replace, or a validation rule. If your expression is invalid, you get a plain-language error instead of a silent failure.
All matching happens locally in your browser using the same JavaScript regular-expression engine your code will use, so the results you see here match what you will get in a real script. Nothing you paste is uploaded, which makes it safe to test patterns against sensitive sample data, and the global flag is applied automatically so you always see the complete set of matches rather than just the first.
Features
- Runs your regular expression against the pasted text and lists every match it finds.
- Shows the starting index of each match so you know exactly where in the text it occurs.
- Displays the contents of every capture group beside each match for quick verification.
- Lets you set flags such as case-insensitive, multiline and dot-all to control matching.
- Always includes the global flag so the full set of matches is returned, not only the first.
- Reports a clear error message when the pattern is invalid instead of failing silently.
- Runs entirely in your browser using the JavaScript engine, so results match your real code.
How to use Regex Tester
- Enter your regular expression pattern in the pattern option, without the surrounding slashes.
- Add any flags you need, such as i for case-insensitive or m for multiline matching.
- Paste the text you want to test the pattern against into the main input box.
- Read the results table to see each match with its index and any capture group contents.
- Adjust the pattern or flags and re-run until the matches are exactly what you expect.
Benefits
- Developers verify a pattern behaves correctly before embedding it in production code.
- Data wranglers confirm an extraction pattern captures the right fields from sample records.
- Learners see immediately how flags and groups change what a regular expression matches.
- QA engineers test validation rules against edge-case inputs to find gaps before release.
- Content editors check that a find-and-replace pattern will hit exactly the intended text.
- Because matching is local, sensitive sample data used for testing never leaves your browser.
A regular expression describes a search pattern, and the flags that accompany it change how that pattern is applied. The case-insensitive flag makes letters match regardless of case, the multiline flag makes the start and end anchors apply to each line, and the dot-all flag lets the dot match newline characters. This tester always adds the global flag so you can see every match at once, which is the most useful view when checking coverage.
The capture-group column shows the text captured by each set of parentheses in your pattern, separated so you can read them individually. Groups are how you pull specific pieces out of a match, such as the year, month, and day from a date, so seeing them here confirms your grouping is correct before you rely on it. An empty groups cell simply means the pattern has no capturing parentheses or the group did not participate in that match.
Everything runs in your browser with the standard JavaScript engine and nothing is transmitted, so the tool is safe for private sample data and produces results identical to your own scripts. Be mindful that certain patterns can backtrack heavily on large inputs, so if a run feels slow, simplify the expression. The tester also guards against zero-width matches looping forever, so pathological patterns stop cleanly instead of hanging.