DEV-TRAFFIC-084 · Custom Tool

Regex Tester & Debugger

Run a JavaScript regular expression against test text and inspect match positions, numbered capture groups, and named groups.

EmbedReport issue
Ready · browser-local
Custom Tool

Regex Tester & Debugger workspace

Flags
Test text71 characters
0 matchesGlobal search
No matches yet.Run the tester to inspect match ranges and capture groups.
ProcessingBrowser-firstStorageNone by defaultAccessNo account required
WORKED EXAMPLE

Regex Tester & Debugger example

Offsets are JavaScript UTF-16 string indexes.

Example input

Pattern: (?<word>\b[A-Z][a-z]+\b)
Flags: g
Text: Ada builds tools. Grace reviews them.

Expected output

2 matches
Ada — offsets 0–3 — named group word: Ada
Grace — offsets 18–23 — named group word: Grace
INSTRUCTIONS

How to use Regex Tester & Debugger

  1. 1

    Enter a JavaScript regular-expression pattern without slash delimiters.

  2. 2

    Select global, case-insensitive, multiline, dotAll, or Unicode flags.

  3. 3

    Paste test text and choose Test expression.

  4. 4

    Inspect matches and capture groups. Correct any inline syntax error and run again.

PURPOSE

What this tool does

The tester constructs the browser's native JavaScript RegExp with the selected flags and enumerates matches in source order.

Each result reports its start and end offsets, full matched text, numbered captures, and named captures when the expression defines them.

SUPPORTED BEHAVIOR

Features and options

  • JavaScript RegExp dialect
  • g, i, m, s, and u flags
  • Numbered and named captures
  • Match offsets
  • Unicode property escapes when the u flag is enabled
  • Safe progress through zero-length global matches
IMPLEMENTATION NOTES

Technical information

Matching behavior comes from the browser's ECMAScript RegExp implementation. Lookahead and lookbehind support therefore follows the current browser engine.

Without the global or sticky flag, JavaScript returns only the first match. Global results are capped at 500 to keep the interface responsive. UTF-16 code-unit offsets are shown, matching JavaScript's string indexing model.

WHEN IT HELPS

Common use cases

  • Testing validation patterns
  • Inspecting capture groups
  • Debugging anchors and flags
  • Checking Unicode matching
  • Finding the location of repeated matches
REVIEW BEFORE USING

Limitations

  • This is not a PCRE, Python, Java, .NET, Go, or Rust regex engine.
  • Replacement and substitution are not implemented in this tool.
  • The tester does not estimate ReDoS risk or guarantee that an expensive expression will complete quickly.
  • Results stop after 500 matches.
NEXT LOGICAL TASKS
AUTHORITATIVE MATERIAL

References & Sources

QUICK ANSWERS

Regex Tester & Debugger FAQ

Which regex flavor is supported?

The JavaScript ECMAScript RegExp dialect provided by your browser.

Why do I see only one match?

Enable the g flag to enumerate all non-overlapping matches.

Are lookbehind and Unicode properties available?

They are available when supported by the current browser. Unicode property escapes normally require the u flag.

KEEP EXPLORING

More Tools in Regular Expressions & Pattern Matching

View all Regular Expressions & Pattern Matching tools →