Skip to main content
Text UtilitiesTerminable Worker · Inert Text Preview · Cap 200,000 chars / 500 matches

Find & Replace · Regex Tester

Inspect JavaScript regex matches, named and numbered capture groups, Unicode code-point indices, and live replace previews inside a timeout-protected worker.

//gu
Flags:
0 / 200,000 chars

Match Highlights (Plain-Text Safe Render)

Evaluating in worker…
Highlighted matches appear here as harmless plain text…

Replace Preview

Match Details & Capture Groups

0 shown

Enter a search pattern to inspect match ranges, UTF-16 vs Unicode code point indices, and numbered or named capture groups.

Tool Documentation & Guide

Regular Expression Tester & Debugger Guide

Test and debug JavaScript regular expressions with real-time match highlighting and ReDoS timeout safety.

Overview

The Regex Tester evaluates JavaScript regular expressions against test text in real time. It highlights matches and capture groups, supports standard flags (g, i, m, s, u, v), provides search-and-replace preview, and executes evaluations in an isolated Web Worker with a 1,500ms timeout to prevent browser lockups from catastrophic backtracking.

How to Test Regular Expressions

1Enter Regex Pattern & Flags

Type your regular expression pattern and toggle flags (Global, Case-Insensitive, Multiline, DotAll, Unicode, Unicode Sets).

2Paste Test Text

Enter sample text in the test area. Matches and numbered/named capture groups highlight automatically.

3Test Replacement (Optional)

Enter a replacement pattern using standard substitution tokens ($1, $<name>, $&) to preview output.

Execution Bounds & Safety
  • Pattern length limit: 2,000 characters.
  • Test string limit: 200,000 characters.
  • Maximum match results capped at 500 to keep rendering smooth.
  • 1,500ms hard worker timeout protects against ReDoS catastrophic backtracking.
Isolated Worker Execution
  • Regex evaluation runs in a dedicated local Web Worker.
  • Patterns and test strings remain entirely in browser memory.