← All Tools

.* Regex Tester

Test JavaScript regular expressions with match reports and JSON summaries.

Regex validation checks

Reports invalid pattern errors, match counts, capture groups, execution time, ReDoS risk heuristics, nested quantifier hints, ambiguous alternation hints, possible backtracking risk, and JavaScript-engine compatibility caveats. Safety findings are warnings, not proof a regex is safe.

Runs in your browser

Regex testing runs locally. Debug payloads omit sample text unless you explicitly include it.

What this tool does

Regex Tester checks a regular expression against sample text and reports matches so patterns can be debugged before use.

Why it is useful

It helps developers, analysts, and operators avoid brittle search, validation, extraction, and replacement patterns.

How it works

The browser applies the JavaScript pattern and flags to sample text, then reports matches, indexes, capture groups, and safety hints.

Best input

Use realistic positive and negative sample strings, then check match counts and captures before shipping the expression.

Safety tip

Treat ReDoS and backtracking warnings as review prompts. They are heuristics, not formal proof that a pattern is safe or unsafe.

Privacy note

Regex testing happens locally in your browser.

Important limitation

Different regex engines support different features. This tool uses JavaScript regular expression behavior.

Quick answers

Does this show capture groups?

Yes. Matching groups are shown next to each match when the JavaScript engine returns them.

Can agents call this directly?

Yes. The API examples below show deterministic /api/run calls with pattern, flags, and text.

API examples

Call the same deterministic core through Utilito’s compact API router. Send only data you intentionally submit to the server-side endpoint.

Try in API playground →Schema →
Test a regex with curl
curl
curl -X POST https://utilito.dev/api/run \
  -H "Content-Type: application/json" \
  -d '{"tool_id":"regex-tester","input":{"pattern":"\b[\w.%+-]+@[\w.-]+\.[A-Za-z]{2,}\b","flags":"gi","text":"Contact [email protected] or [email protected]"}}'
Test a regex from JavaScript
javascript
const res = await fetch('https://utilito.dev/api/run', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    tool_id: 'regex-tester',
    input: { pattern: '[w.%+-]+@[w.-]+.[A-Za-z]{2,}', flags: 'gi', text: 'Contact [email protected] or [email protected]' }
  })
});
const data = await res.json();
console.log(data.result.output || data.result.report);
Test a regex from Python
python
import requests
payload = {
    "tool_id": "regex-tester",
    "input": {"pattern": "\b[\w.%+-]+@[\w.-]+\.[A-Za-z]{2,}\b", "flags": "gi", "text": "Contact [email protected] or [email protected]"},
}
result = requests.post("https://utilito.dev/api/run", json=payload).json()["result"]
print(result.get("output") or result.get("report"))

Common Use Cases

Debug extraction patterns

Confirm matches and capture groups before using a regex in code.

Test validation patterns

Try positive and negative sample strings before shipping form validation.

Document regex behavior

Copy the JSON summary into PRs or issue comments to explain expected matches.

Related Tools

{}JSON Formatter🔐Base64 Encode / Decode🔗URL Encoder / Decoder<HTML Entity Encoder🎫JWT Decoder🎯JSON Path Tester
View all in Code →