About Regex Tester
This regex tester lets you try a regular expression against your own text and see the result immediately. Enter a pattern and flags, paste a test string, and every match is highlighted in the text. Below it you get a list of matches with their position and the values of capture groups. Matches update as you type.
The engine is the JavaScript (ECMAScript) regular expression engine of your browser, so the result matches what you will get in JavaScript or Node.js, while other languages such as PCRE or Python may differ in details. Supported flags are d, g, i, m, s, u and y, and invalid patterns show the browser's error message. Your text stays on your device.
How to use Regex Tester
- 01
Enter your pattern and flags.
- 02
Paste a test string.
- 03
See highlighted matches and capture groups.
When to use it
- Building a pattern to validate an email, phone number or ID before putting it in code.
- Extracting parts of a log line using capture groups and checking each group.
- Testing a find-and-replace pattern against sample text before running it on a project.
- Learning how flags such as i, m and s change what a pattern matches.
- Debugging why a pattern matches too much, too little or nothing at all.
Frequently asked questions
Which regex flavor does this tester use?
JavaScript (ECMAScript), using your browser's own engine. Patterns that rely on features from PCRE, Python or Java, such as some lookbehind variants or inline modifiers, may behave differently or be rejected.
Which flags are supported?
You can use d, g, i, m, s, u and y. Other characters typed in the flags box are ignored. The g flag is always applied so that every match in the text is found and listed.
How do I see capture groups?
Wrap part of the pattern in parentheses. Each match in the list shows its position and the values of the groups. Groups that did not take part in the match are shown as null.
Why does the tester show only some matches?
The highlighting stops after 1,000 matches to keep the page responsive, and the list below shows the first 50. Narrow your test text or pattern if you need to inspect later matches.
What does an error message mean?
The pattern is not valid in JavaScript, for example an unclosed parenthesis, a bad escape or an invalid group. The message comes from the browser itself and usually names the problem.
Is my test text uploaded?
No. The pattern and text are evaluated in your browser, so sample data such as logs or emails never leaves your device. The tool is free and has no sign-up.