Caspian Office

Regex tester

Test a regular expression against sample text with live match highlighting, capture groups, flag toggles and a replace preview. A cheatsheet is built in. Fully offline.

Open Regex tester →
Private · runs in your browserOffline · after first loadFree · no signup

What is the regex tester?

A tool for testing a regular expression against sample text with live match highlighting, a count of matches, flag toggles and a replace preview — plus a quick cheatsheet. It runs entirely in your browser, with no internet needed, and remembers your pattern and text on this device.

How to use Regex tester

  1. Type your pattern — Enter a regular expression between the slashes. Toggle the flags — g, i, m, s and u — to control global, case-insensitive, multiline, dotall and unicode matching.
  2. Paste test text — Add your sample text in the Test string box. Matches are highlighted live as you type, with a running count.
  3. Check the matches — Review the highlighted matches to confirm your pattern catches exactly what you intend, and nothing extra.
  4. Preview a replacement — Type a replacement in the Replace box — use $1, $2 to reference capture groups — to preview the substituted result.

Frequently asked questions

Which regex flavour does it use?

It uses the browser's built-in JavaScript regular-expression engine, so patterns behave exactly as they would in JavaScript code.

What do the flag buttons do?

g matches all occurrences, i ignores case, m makes ^ and $ match line breaks, s lets the dot match newlines, and u enables full unicode matching.

How do I use capture groups in a replacement?

Reference each captured group in the Replace box with $1, $2 and so on — the preview shows the substituted output live.

Is my pattern and text saved?

Yes. Your pattern and test string are stored in your browser on this device, so they're still there when you return. Nothing is uploaded.

What if my pattern is invalid?

If the expression can't be compiled, an error message appears so you can fix the syntax before testing.

Tips

Related tools

← Browse all Caspian Office tools