Developer · free

Regex Tester

Test JavaScript regular expressions live against your own text. See every match with its position, capture groups and flags, fix invalid patterns with clear error messages, and copy a ready-to-use regex.

Runs on your device — nothing uploadedNo sign-up or limitUpdated October 2026

g = global, i = case-insensitive, m = multiline, s = dotall, u = unicode, y = sticky. You can also type /pattern/gi in the Pattern box.

Runs the standard JavaScript RegExp engine. Test text is processed locally.

Enter a pattern and press Test.

About the Regex Tester

Test JavaScript regular expressions live against your own text. See every match with its position, capture groups and flags, fix invalid patterns with clear error messages, and copy a ready-to-use regex.

Patterns and text are evaluated only in your browser.

How to use the Regex Tester

  1. Step 1Type a pattern (no slashes needed) and pick flags such as g for global.
  2. Step 2Paste or type the text you want to search.
  3. Step 3Press <strong>Test</strong> to see highlighted matches and a list with positions.

When people reach for this tool

See what a pattern actually matches

Every match, with its position and capture groups, removes the guesswork from a pattern that looks plausible.

Get a clear message for an invalid pattern

An unbalanced bracket or a stray quantifier is reported precisely instead of silently matching nothing.

Pull structured values out of messy text

Named groups turn a wall of log lines into a table of separate fields.

Practical tips

  • JavaScript regular expressions are not the same as PCRE or POSIX. A pattern that works in a search engine may need rewriting here.
  • A pattern that matches nothing is far more often too greedy than too strict — try removing the outermost group.

What you get

  • Runs the real JavaScript RegExp engine
  • Live highlight of every match in your text
  • Match list with positions and capture groups
  • Supports g, i, m, s, u and y flags
  • Clear, human-friendly error messages

Regex Tester — FAQ

Does it support lookahead and named groups?
Yes — anything your browser’s RegExp supports, including lookahead, lookbehind and named capture groups with the u flag.
Why is nothing highlighted?
The pattern matched nothing. Try the g flag, or check the error message for invalid syntax such as an unclosed parenthesis.
Why does my pattern match nothing?
The usual suspects are unescaped special characters, a greedy group that consumes more than intended, or anchors placed where there is no line break to anchor to.
What are the flags for?
Common ones are g for every match rather than the first, i to ignore case, and m so ^ and $ match each line rather than the whole string.

More developer tools

All 17 other tools in this collection — free, no sign-up, nothing uploaded.

← All 104 tools · A–Z index · Browse by what you are doing