Regex Tester & Debugger
Run a JavaScript regular expression against test text and inspect match positions, numbered capture groups, and named groups.
Regex Tester & Debugger workspace
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: GraceHow to use Regex Tester & Debugger
- 1
Enter a JavaScript regular-expression pattern without slash delimiters.
- 2
Select global, case-insensitive, multiline, dotAll, or Unicode flags.
- 3
Paste test text and choose Test expression.
- 4
Inspect matches and capture groups. Correct any inline syntax error and run again.
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.
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
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.
Common use cases
- Testing validation patterns
- Inspecting capture groups
- Debugging anchors and flags
- Checking Unicode matching
- Finding the location of repeated matches
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.
Related tools
References & Sources
Defines the JavaScript RegExp object and normative matching behavior used by this browser-local tester.
Verified 2026-08-13 ↗MDN Web Docs · Official DocumentationMDN JavaScript RegExp ReferencePractical reference for JavaScript regular-expression syntax, flags, methods, and browser behavior.
Verified 2026-08-13 ↗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.