Skip to content

Developer Tools

Regex Tester & Debugger

Experiment with regular expressions, inspect every matched occurrence and named capture group, and test replacements with zero server transmission.

100% Client-Side Engine: Regex evaluation executes natively using your browser’s JavaScript RegExp engine. No string data is sent over the network.
Popular Presets:
//gi
Flags:
147 characters

🎯 Matched Segments

2 matches found
Match #1Index: 38..87 (49 chars)
https://technologytools.site/tools/json-formatter
Capture Groups:
$protocol:https
$domain:technologytools.site
$path:/tools/json-formatter
Group 1 ($ 1):https
Group 2 ($ 2):technologytools.site
Group 3 ($ 3):/tools/json-formatter
Match #2Index: 108..147 (39 chars)
https://github.com/valdemoko/techtools.
Capture Groups:
$protocol:https
$domain:github.com
$path:/valdemoko/techtools.
Group 1 ($ 1):https
Group 2 ($ 2):github.com
Group 3 ($ 3):/valdemoko/techtools.

Regex Errors That Cost Hours

  • Greedy matching: .* eats across your intended boundary — .*? or a negated class [^>] usually expresses the real intent.
  • Forgetting the g flag: the first match hides the rest, making a correct pattern look broken.
  • Escaping inside character classes: [.] matches a literal dot, but [.] is a redundant escape — and [-] placement changes meaning.
  • Multiline assumptions: ^ and $ match string ends unless the m flag is set, which silently breaks per-line validation.
  • Catastrophic backtracking: nested quantifiers like (a+)+ on adversarial input can hang the engine — test patterns on realistic samples, not just the happy case.

How the Tool Works

  1. Type your regular expression in the pattern field and pick flags such as g (global), i (case-insensitive), m (multiline), or u (unicode).
  2. Paste a test string. Every match is highlighted inline with its index position in the input.
  3. The match inspector lists each result with its capture groups — both numbered and named groups are expanded.
  4. Use the replace box to preview a substitution live (for example $1 to reference group 1) before applying it in your code.

Example Input & Output

Extract email local part and domain
Input: Pattern /^(\w+)@([\w.]+)$/ on ana.smith@example.com
Output: Group 1: ana.smith — Group 2: example.com
Numbered capture groups split the match into reusable pieces for validation or data transformation in scripts.
Find duplicate words
Input: Pattern /\b(\w+)\s+\1\b/gi on "the the quick fox"
Output: Match found at index 0: "the the"
The backreference \1 repeats group 1, a classic way to detect duplicated words in prose with a single pattern.

Common Questions

Which regex flavor is used?

The JavaScript flavor (ECMAScript), the same engine as Node.js and all modern browsers. Features include lookahead, named groups, and the u flag for Unicode.

How do I read the match inspector?

Each result shows the matched text, the start index, and every capture group. Expanding a group reveals its content and position, which is how you debug extraction logic.

Is my text sent anywhere?

No. Matching runs entirely in-browser, so private logs and user data stay on your device.