A live regex playground in your browser
The Regex Tester lets you build a regular expression and watch it match against your own sample text in real time. It is handy for developers writing validation rules, anyone scraping or cleaning data, and people who just want to confirm a pattern catches the right strings before pasting it into code. Because it runs on the browser’s native JavaScript engine, the matches you see here are the same ones your app will get.
How to use the Regex Tester
- Paste or type the text you want to search into the large input box.
- In the Pattern field, enter your regular expression, for example
\b\w+@\w+\.\w+\bto find email-like strings. - In the Flags field, add the flags you need such as
ifor case-insensitive ormfor multiline. The default isg. - Read the output: it lists how many matches were found, each matched substring with the index where it starts, and any capture group values.
- Tweak the pattern and flags until the matches look right, then copy your expression into your project.
Why test your regex here
It is fast, free, and there is no sign-up. Nothing you paste leaves your machine, which matters when your sample text contains logs, emails, or other private data. The result updates as you type, so you can iterate quickly instead of re-running a script. If your pattern is broken, you get a clear “Invalid regex” message explaining what went wrong rather than a silent failure.
A quick tip
Start broad and narrow down: write a loose pattern first, confirm it catches your targets, then tighten it with anchors like ^, $, or \b to cut false positives. Add capture groups with parentheses when you want to pull pieces out of each match, and the tool will show you exactly what each group grabbed.
Frequently asked questions
- What regex flavor does this tester use?
- It uses the JavaScript (ECMAScript) RegExp engine built into your browser, the same one Node.js and web apps use. So patterns like \b, \w, \d, named groups, lookaheads and Unicode escapes behave exactly as they would in JS code.
- Which flags can I set?
- Type any combination of standard flags in the Flags box: g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode) and y (sticky). The g flag is added automatically so the tool can list every match, not just the first.
- Does it show capture groups and match positions?
- Yes. For each match the result shows the matched text in quotes plus the character index where it starts. If your pattern has capture groups, those captured values are listed too, so you can confirm a group grabbed what you expected.
- What happens if my pattern has a syntax error?
- The tool catches the error and shows an 'Invalid regex' message with the reason from the engine, for example an unterminated group or bad quantifier. Fix the pattern and the matches update right away.
Related developer tools
Last updated: June 15, 2026