Skip to content
AnyToolBox

Search tools

Find a tool by name or keyword

Regex Tester

Test JavaScript regular expressions with live match highlighting, capture groups and replace preview.

100% Client-Side

Enter a pattern and flags, paste test text, and see every match and capture group as you type.

How to use the Regex Tester

  1. 1

    Type your regular expression in the pattern box (without the surrounding slashes).

  2. 2

    Toggle flags such as g (global), i (ignore case), m (multiline) and s (dot matches newlines).

  3. 3

    Paste the text to test — matches are highlighted live.

  4. 4

    Inspect each match's position and its numbered and named capture groups.

  5. 5

    Enter a replacement (with $1, $<name> and so on) to preview the replaced text.

Frequently asked questions

Your browser's JavaScript RegExp engine — the same one that runs in Node.js and front-end code. Syntax specific to PCRE, Python or .NET, such as possessive quantifiers or inline (?i) modifiers, may not work.

Matching runs in a separate background worker with a time limit. If a pattern takes longer than about two seconds, the worker is stopped and you'll see a warning, so the page never freezes.

Use $1, $2 and so on for numbered groups, $<name> for named groups, $& for the whole match and $$ for a literal dollar sign — exactly as in JavaScript's String.replace.

Without the g (global) flag, a JavaScript regex stops after the first match. Turn on g to find every match in the text.

No. Patterns and text are processed only in your browser, so you can safely test against logs or data that contain private information.

Missing a feature or tool?

Tell us what would make Regex Tester more useful, or what to build next.