Skip to content
utilhex

Regex Tester

Test regular expressions against sample text with match highlighting, capture groups, and replace. Private, local, and uses JavaScript regex syntax.

Runs in your browserFree · No sign-up

About Regex Tester

Regex Tester lets you try a JavaScript regular expression against sample text. Matches are highlighted in place, capture groups are listed, and a replace field shows the result of substitution tokens such as $1 and $&. The pattern never leaves your browser.

How to use Regex Tester

  1. Enter a pattern and the flags you need (g, i, m, s, u, y, d).
  2. Paste the text you want to test.
  3. Review highlighted matches and capture groups.
  4. Optionally enter a replacement string to preview substitutions.

Examples

Words

The pattern \w+ with the global flag finds every word in a sentence.

Named groups

(?<year>\d{4})-(?<month>\d{2}) captures 2026-10 as year = 2026 and month = 10.

Limitations

  • The engine is JavaScript’s RegExp, not PCRE or Python. Lookbehind and Unicode property escapes need a modern browser.
  • Patterns that backtrack heavily are stopped after two seconds so the page stays usable.
  • Replacement uses JavaScript substitution tokens ($1, $&, $`, $', $<name>).

Privacy

This tool processes everything locally in your browser tab. Your input is not uploaded to Utilhex or any third party, and it is discarded when you close or reload the page. Read the privacy policy for details.

Frequently asked questions

Is my input sent anywhere?

No. Processing happens in your browser. Utilhex does not send tool input to its servers, analytics, or any AI service.

Do I need slashes around the pattern?

No. Enter the pattern only. Flags are chosen separately, so /foo/gi is the pattern foo with the g and i flags.

Why did testing stop?

A pattern that takes too long, or that would produce more than 2,000 matches, is stopped so the tab stays responsive. Simplify the pattern or shorten the text.