JavaScript Regex Tester

Test a regular expression against your own sample text with this free online regex tester that runs entirely in your browser. Type a JavaScript regex pattern, toggle the g, i, m, s and u flags, and watch the match count, highlighted matches and captured groups update live as you type. Invalid patterns are flagged instantly with the exact error message, so you can debug your regular expression fast. This regex tester uses the browser's native RegExp engine, and because everything is compiled and run locally, your pattern and test string are never uploaded and stay completely private.

πŸ”’ 100% private β€” files never leave your device

Loading…

How to use

  1. Type your regular expression into the pattern box.
  2. Toggle the g, i, m, s and u flags you need.
  3. Paste your test string to see every match highlighted inline.
  4. Review the captured groups and copy the matches with one click.

Frequently asked questions

What regex syntax does this tester support?

It uses your browser's built-in JavaScript RegExp engine, so it supports exactly the JavaScript regular expression syntax, including character classes, lookaheads, backreferences and named capture groups.

What do the g, i, m, s and u flags do?

g finds all matches instead of just the first, i makes matching case-insensitive, m makes ^ and $ match line boundaries, s lets the dot match newlines, and u enables full Unicode mode for the pattern.

Why does the tester show captured groups?

When your pattern contains parentheses, each match lists the text captured by every numbered and named group, so you can confirm your groups capture exactly what you expect. An empty group is shown as βˆ….

Is my pattern or test text uploaded anywhere?

No. The regex is compiled and run locally in your browser, so your pattern and test string never leave your device and nothing is sent to a server.

What happens if my regular expression is invalid?

The tester catches the error the moment you type an invalid pattern and shows the exact message from the JavaScript engine, so you can spot the problem, such as an unclosed group or bad flag, right away.

Is there a limit on how much text I can test?

There is no upload limit because everything runs in your browser. You can paste large sample strings, and the tester scans for every match while safely stopping runaway patterns to keep your browser responsive.

About this tool

Free online regex tester. Build and test JavaScript regular expressions with live match highlighting, flags and capture groups. Runs 100% in your browser, nothing uploaded.

Related tools