Skip to content
BEAD

Regex Tester

Test JavaScript regular expressions with live match highlighting and capture groups.

Pattern
//
Highlighted matches
Email: alice@example.com
Phone: (415) 555-2671
Date: 2026-05-26
URL: https://b-e-a-d.com/tools/regex-tester
1 match
  1. #1alice@example.com[7, 24)

🔒 Patterns run entirely in your browser.

</>Use this tool programmaticallycurl · JavaScript · MCP

Same tool, callable from any HTTP client or from Claude (via MCP). Anonymous: 100 req/day per IP. Sign up for 1,000 req/day.

curl
curl https://api.b-e-a-d.com/tools/regex-tester/run \
  -H "Content-Type: application/json" \
  -d '{
  "pattern": "\\d+",
  "flags": "g",
  "text": "hello world"
}'
JavaScript (fetch)
const res = await fetch("https://api.b-e-a-d.com/tools/regex-tester/run", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "pattern": "\\d+",
  "flags": "g",
  "text": "hello world"
}),
});
const data = await res.json();
console.log(data.result);
MCP (Claude Desktop / Claude Code)
# In Claude Desktop / Claude Code, add to your MCP config:
{
  "mcpServers": {
    "bead": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.b-e-a-d.com"]
    }
  }
}

# Then ask Claude to call:
mcp__bead__bead_regex_tester

Full reference: developer docs · OpenAPI spec

About this tool

Uses the JavaScript RegExp engine — the same one your browser uses. Patterns here behave like patterns in your code. PCRE features like lookbehind variable length, recursion, or possessive quantifiers may differ.

Flag cheatsheet

  • g — global, match all occurrences
  • i — case insensitive
  • m — multiline, ^/$ match line breaks
  • s — dot matches newlines
  • u — unicode escapes

Frequently asked

What regex flavor does this use?

ECMAScript regex — what runs in your browser. It supports most of what you'd write in Python, Go, or Ruby, but not Perl's recursive patterns or .NET balanced groups. If you need a specific flavor, test in that environment too.

Why are my matches different from grep?

grep uses POSIX BRE/ERE by default which is more restrictive. Try grep -P for Perl-compatible matching. Common gotchas: \d means [0-9] in JS but [[:digit:]] in POSIX, and \b means word boundary in JS but backspace in POSIX.

How do I test a multi-line pattern?

Add the m flag — it makes ^ and $ match at line boundaries instead of just start/end of input. Add s to make . match newlines (otherwise it doesn't).

You might also like