UtilityTools

Regex Tester

Test regular expressions with live match highlighting, flags, and a cheat sheet.

About this tool

About

This regex tester lets you try JavaScript regular expressions against sample text in your browser. See matches highlighted as you type, inspect capture groups, preview replacements, and use a cheat sheet of common tokens—without uploading your data.

How it works

You enter a pattern and optional flags (g, i, m, s, u). The tool builds a JavaScript RegExp and runs it on your test string. Matches are listed with start/end indexes and groups. If you fill in a replace template, a live preview shows the result using standard $1 / $& style replacements. Very slow patterns are stopped early so the page stays responsive.

Steps

  1. Enter a pattern (or click Sample / pick tokens from the cheat sheet).
  2. Toggle flags such as g (global) or i (ignore case).
  3. Paste or type a test string and watch matches highlight.
  4. Review the match list for indexes and capture groups.
  5. Optionally add a replace template and copy the preview.

Frequently asked questions

Is this regex tester free?

Yes. It is free to use with no signup. Test patterns, flags, and replacements as much as you need.

Is my text uploaded to a server?

No. Matching runs entirely in your browser. Your test strings are not sent to Utility Tools servers.

Which regex flavor does this use?

JavaScript’s built-in RegExp engine (the same rules as in the browser). It is not PCRE or Python’s re module, so some advanced syntax may differ.

What do the g, i, and m flags mean?

Global (g) finds every match, not just the first. Ignore case (i) treats A and a as the same. Multiline (m) makes ^ and $ work per line. DotAll (s) lets . match newlines. Unicode (u) handles emoji and non-ASCII more correctly. Each flag on the tool shows a short description.

Why did matching stop early?

Some patterns can run for a long time on large text (catastrophic backtracking). This tool stops after a short time limit and shows a warning so the page does not freeze.

Privacy: Your pattern and test text stay in this browser. A draft may be remembered in local storage on this device. Nothing is sent to our servers.