Regex Tester

Test regular expressions with live match highlighting, flag toggles, capture group inspection, and a pattern explainer — all in your browser.

//g
Flags:
Test String
search

Enter a regex pattern above to see matches.

How to use Regex Tester

  1. 1
    Enter your regex pattern

    Type your regular expression into the pattern bar at the top. The left and right delimiters (/…/flags) are displayed automatically so you can see the full regex at a glance.

  2. 2
    Toggle flags to control matching behaviour

    Click the flag pills (g, i, m, s, u, y) to enable or disable them. 'g' finds all matches, 'i' makes matching case-insensitive, 'm' lets ^ and $ match line starts and ends, and so on.

  3. 3
    Paste your test string and see live highlights

    Type or paste any text into the Test String area. Matches are highlighted instantly in colour-coded spans below the input, and a match count badge appears in the corner.

  4. 4
    Inspect matches, try replacements, or explain the pattern

    Switch between the Matches tab (see each match with capture groups), the Replace tab (preview find-and-replace output using $1/$2/$& templates), and the Explain tab (get a plain-English breakdown of every token in your pattern).

Frequently Asked Questions

Does my data leave the browser?

No. All regex matching and processing happens entirely in your browser using the built-in JavaScript RegExp engine. Your patterns and test strings are never transmitted to any server.

Which regex flavour does this tool support?

The tool uses the JavaScript (ECMAScript) regex engine built into your browser. This supports most common syntax including lookaheads, lookbehinds, named capture groups, and Unicode property escapes with the 'u' flag.

What do the flags mean?

g (global) finds all matches instead of just the first. i (case insensitive) ignores letter case. m (multiline) makes ^ and $ match line boundaries. s (dot-all) lets . match newline characters. u (unicode) enables full Unicode mode. y (sticky) matches only from the lastIndex position.

Why does my pattern show an error?

A red error banner means your pattern contains invalid regex syntax — for example, an unclosed group like '(' or an invalid escape sequence. The error message from the JavaScript engine is shown verbatim to help you diagnose the issue.

Related Tools