OpenClaw Regex Engine v2.0
Master regular expressions -- 5 tools to test, explain, build, browse, and replace patterns instantly.
Quick Reference
| Situation |
Action |
Tool |
| Have a regex, need to test it |
Run against text, get all matches + groups |
regex_test |
| Found a scary regex in legacy code |
Get plain-English breakdown of every token |
regex_explain |
| Know WHAT to match but not HOW |
Describe in English, get production regex |
regex_build |
| Need a standard pattern (email, URL, IP) |
Browse 50+ battle-tested patterns |
regex_library |
| Need to transform text with regex |
Find-replace with backreferences ($1, $2) |
regex_replace |
| Complex pattern with capture groups |
Test + Explain combo for full understanding |
regex_test + regex_explain |
What's New in v2.0
- :brain: PatternForge Builder -- Describe what you want in plain English. Get a production-ready regex with positive/negative test cases, flags, and explanation included.
- :book: RegexLens Explainer -- Break any regex into human-readable components token-by-token. Even nested lookaheads, possessive quantifiers, and Unicode categories.
- :file_cabinet: BattleTest Library -- 50+ curated patterns for email, URL, phone (international), IPv4/IPv6, UUID, JWT, credit card, date formats, file paths, and more. Every pattern includes test cases.
- :arrows_counterclockwise: SmartReplace Engine -- Full backreference support including named groups, global/first-match modes, and before/after diff preview.
MCP Quick Start
{
"openclaw-regex": {
"type": "streamable-http",
"url": "https://regex-engine-mcp.yagami8095.workers.dev/mcp"
}
}
Add to Claude Desktop, Cursor, Windsurf, VS Code, or any MCP-compatible client. No API key needed for Free tier. Works immediately.
Detection Triggers
This skill activates when you say:
- "test this regex" / "does this pattern match" / "run this regex against"
- "explain this regex" / "what does this regex do" / "break down this pattern"
- "build a regex for" / "create a pattern that matches" / "regex for emails"
- "regex for URL" / "phone number regex" / "UUID pattern" / "IP address regex"
- "regex replace" / "find and replace with regex" / "search and replace with capture groups"
- "regular expression" / "pattern matching" / "capture groups" / "backreference"
Tools (5)
regex_test -- Match & Capture (PatternMatch Protocol)
Test a regex pattern against input text. Returns every match with full capture group detail, named groups, and exact index positions.
| Parameter |
Type |
Default |
Description |
pattern |
string |
required |
Regex pattern to test |
text |
string |
required |
Input text to match against |
flags |
string |
"g" |
Flags: g global, i case-insensitive, m multiline, s dotall, u unicode, v unicodeSets |
Output: { matchCount, matches: [{ index, match, groups: [], namedGroups: {} }], executionTimeMs }
WRONG vs RIGHT
WRONG -- Manually scanning text to check if a pattern works:
User: Does this regex match my test string?
Agent: *reads the regex visually, guesses "yes it should match"* — misses edge case with nested groups
RIGHT -- Use regex_test:
User: Does this regex match my test string?
Agent: calls regex_test → "3 matches found. Match 1 at index 15: 'user@example.com', group 1: 'user', group 2: 'example.com'"
regex_explain -- Human-Readable Breakdown (RegexLens)
Break any regex into plain English, token by token. Each component gets a description, what it matches, and example matches.
| Parameter |
Type |
Default |
Description |
pattern |
string |
required |
Regex pattern to explain |
flags |
string |
"" |
Active flags to include in explanation |
Handles: Character classes, quantifiers, anchors, groups (capturing, non-capturing, named), lookahead/lookbehind (positive and negative), backreferences, Unicode categories, and alternation.
Output: Array of { token, type, description, matches_example } plus overall summary.
WRONG vs RIGHT
WRONG -- Staring at ^(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%])[A-Za-z0-9!@#$%]{8,}$ and guessing:
User: What does this regex do?
Agent: *guesses* "It matches passwords maybe?" — no detail on the lookaheads or minimum length
RIGHT -- Use regex_explain:
User: What does this regex do?
Agent: calls regex_explain → "Password validator: requires at least 1 uppercase letter (lookahead 1), 1 digit (lookahead 2), 1 special char from !@#$% (lookahead 3), minimum 8 characters total from allowed set"
regex_build -- Natural Language to Regex (PatternForge)
Describe what you want to match in plain English. Get a production-ready regex with recommended flags, explanation, and test cases (both positive and negative).
| Parameter |
Type |
Default |
Description |
description |
string |
required |
Plain English description of what to match |
options |
object |
{} |
strict: boolean for anchored patterns, examples: string[] for guidance |
Output: { pattern, flags, explanation, testCases: { shouldMatch: [], shouldNotMatch: [] } }
Example: Input "match email addresses" produces a complete RFC-5322-lite pattern with 5 positive and 5 negative test cases.
regex_library -- Pattern Collection (BattleTest Library)
Browse 50+ curated, production-tested regex patterns organized by category. Every pattern includes the regex string, description, recommended flags, and positive/negative test cases.
| Parameter |
Type |
Default |
Description |
category |
string |
"" |
Filter by category: email, url, ip, phone, date, uuid, jwt, credit_card, password, html, file_path, css |
search |
string |
"" |
Free-text search across pattern names and descriptions |
Categories: email, URL, IPv4, IPv6, phone (US, UK, JP, international), date (ISO, US, EU), UUID (v1-v5), JWT, credit card (Visa, MC, Amex), password strength, HTML tags, file paths (Unix, Windows), CSS selectors, color codes, semantic versioning.
regex_replace -- Find & Replace (SmartReplace Engine)
Perform regex-based find-and-replace with full capture group reference support ($1, $2, named groups), global and first-match modes.
| Parameter |
Type |
Default |
Description |
pattern |
string |
required |
Regex pattern to find |
replacement |
string |
required |
Replacement string with $1, $2, $<name> references |
text |
string |
required |
Input text to transform |
flags |
string |
"g" |
Regex flags |
Output: { result, replacementCount, diff: { before, after } }
Supports: $1-$9 numbered backreferences, $<name> named backreferences, $& full match, $` pre-match, $' post-match.
What NOT to Do
| Don't |
Why |
Do Instead |
Use catastrophic backtracking patterns like (a+)+$ |
Will timeout on edge workers (~50ms limit) |
Rewrite with atomic groups or possessive quantifiers |
| Expect PCRE-only features (conditional patterns, recursion) |
Uses JavaScript ES2024 regex engine |
Stick to JS-compatible syntax |
| Send input text over 100KB |
Memory limits on edge workers |
Split large texts into chunks |
| Rely on patterns for security validation alone |
Regex is for format checking, not sanitization |
Combine with server-side validation |
Use regex_build for complex parsers |
NL-to-regex handles single patterns, not grammars |
Build complex patterns manually with regex_explain to verify |
Security & Privacy
| What |
Status |
| Reads your input text and patterns |
Yes -- for processing only |
| Stores your data |
No -- zero persistence, stateless edge processing |
| Sends data to third parties |
No -- processed entirely on Cloudflare Workers |
| Logs request content |
No -- only anonymous usage counters |
| Executes patterns server-side |
Yes -- sandboxed with 50ms timeout to prevent ReDoS |
| Requires authentication |
Free tier: no. Pro: API key header only |
Pricing
| Tier |
Calls/Day |
Price |
What You Get |
| Free |
20 |
$0 |
All 5 regex tools, no signup |
| Pro |
1,000 |
$9/mo |
All 9 OpenClaw servers (49 tools), priority routing |
| x402 |
Pay-per-call |
$0.05 USDC |
No account needed, crypto-native |
Get Pro Key: https://buy.stripe.com/4gw5na5U19SP9TW288
The OpenClaw Intelligence Stack
| Server |
Tools |
Best For |
| JSON Toolkit |
6 |
Format, validate, diff, query, transform JSON |
| Regex Engine |
5 |
Test, extract, replace, explain regex patterns |
| Color Palette |
5 |
Generate, convert, harmonize, accessibility-check colors |
| Timestamp Converter |
5 |
Parse, format, diff, timezone-convert timestamps |
| Prompt Enhancer |
6 |
Optimize, rewrite, score, A/B test AI prompts |
| Market Intelligence |
6 |
AI market trends, GitHub stats, competitor analysis |
| Fortune & Tarot |
3 |
Daily fortune, tarot readings, I Ching |
| Content Publisher |
8 |
MoltBook posts, social content, newsletter |
| AgentForge Compare |
5 |
Compare AI tools, frameworks, MCP servers |
All 9 servers share one Pro key. $9/mo = 49 tools.
1---2name: openclaw-regex-engine3description: Production-grade regex processing suite — test patterns with capture groups, explain any regex in plain English, build regex from natural language descriptions, browse 50+ battle-tested patterns, and find-replace with backreferences. Use when: (1) user says 'test this regex' or 'does this pattern match', (2) user asks 'explain this regex' or 'what does this regex do', (3) user needs to 'build a regex for emails' or 'create a pattern that matches URLs', (4) user wants a 'ready-made regex for phone numbers' or 'UUID pattern', (5) user requests 'regex find and replace' or 'search and replace with backreferences'. Supports all ES2024 flags, named groups, lookahead/lookbehind. Zero install, sub-100ms on Cloudflare Workers. Free + Pro $9/mo.4---56# OpenClaw Regex Engine v2.078**Master regular expressions -- 5 tools to test, explain, build, browse, and replace patterns instantly.**910## Quick Reference1112| Situation | Action | Tool |13|-----------|--------|------|14| Have a regex, need to test it | Run against text, get all matches + groups | `regex_test` |15| Found a scary regex in legacy code | Get plain-English breakdown of every token | `regex_explain` |16| Know WHAT to match but not HOW | Describe in English, get production regex | `regex_build` |17| Need a standard pattern (email, URL, IP) | Browse 50+ battle-tested patterns | `regex_library` |18| Need to transform text with regex | Find-replace with backreferences ($1, $2) | `regex_replace` |19| Complex pattern with capture groups | Test + Explain combo for full understanding | `regex_test` + `regex_explain` |2021## What's New in v2.02223- :brain: **PatternForge Builder** -- Describe what you want in plain English. Get a production-ready regex with positive/negative test cases, flags, and explanation included.24- :book: **RegexLens Explainer** -- Break any regex into human-readable components token-by-token. Even nested lookaheads, possessive quantifiers, and Unicode categories.25- :file_cabinet: **BattleTest Library** -- 50+ curated patterns for email, URL, phone (international), IPv4/IPv6, UUID, JWT, credit card, date formats, file paths, and more. Every pattern includes test cases.26- :arrows_counterclockwise: **SmartReplace Engine** -- Full backreference support including named groups, global/first-match modes, and before/after diff preview.2728## MCP Quick Start2930```json31{32 "openclaw-regex": {33 "type": "streamable-http",34 "url": "https://regex-engine-mcp.yagami8095.workers.dev/mcp"35 }36}37```3839Add to Claude Desktop, Cursor, Windsurf, VS Code, or any MCP-compatible client. No API key needed for Free tier. Works immediately.4041## Detection Triggers4243This skill activates when you say:4445- "test this regex" / "does this pattern match" / "run this regex against"46- "explain this regex" / "what does this regex do" / "break down this pattern"47- "build a regex for" / "create a pattern that matches" / "regex for emails"48- "regex for URL" / "phone number regex" / "UUID pattern" / "IP address regex"49- "regex replace" / "find and replace with regex" / "search and replace with capture groups"50- "regular expression" / "pattern matching" / "capture groups" / "backreference"5152## Tools (5)5354### `regex_test` -- Match & Capture (PatternMatch Protocol)5556Test a regex pattern against input text. Returns every match with full capture group detail, named groups, and exact index positions.5758| Parameter | Type | Default | Description |59|-----------|------|---------|-------------|60| `pattern` | string | required | Regex pattern to test |61| `text` | string | required | Input text to match against |62| `flags` | string | "g" | Flags: `g` global, `i` case-insensitive, `m` multiline, `s` dotall, `u` unicode, `v` unicodeSets |6364**Output**: `{ matchCount, matches: [{ index, match, groups: [], namedGroups: {} }], executionTimeMs }`6566#### WRONG vs RIGHT6768**WRONG** -- Manually scanning text to check if a pattern works:69```70User: Does this regex match my test string?71Agent: *reads the regex visually, guesses "yes it should match"* — misses edge case with nested groups72```7374**RIGHT** -- Use `regex_test`:75```76User: Does this regex match my test string?77Agent: calls regex_test → "3 matches found. Match 1 at index 15: 'user@example.com', group 1: 'user', group 2: 'example.com'"78```7980---8182### `regex_explain` -- Human-Readable Breakdown (RegexLens)8384Break any regex into plain English, token by token. Each component gets a description, what it matches, and example matches.8586| Parameter | Type | Default | Description |87|-----------|------|---------|-------------|88| `pattern` | string | required | Regex pattern to explain |89| `flags` | string | "" | Active flags to include in explanation |9091**Handles**: Character classes, quantifiers, anchors, groups (capturing, non-capturing, named), lookahead/lookbehind (positive and negative), backreferences, Unicode categories, and alternation.9293**Output**: Array of `{ token, type, description, matches_example }` plus overall summary.9495#### WRONG vs RIGHT9697**WRONG** -- Staring at `^(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%])[A-Za-z0-9!@#$%]{8,}$` and guessing:98```99User: What does this regex do?100Agent: *guesses* "It matches passwords maybe?" — no detail on the lookaheads or minimum length101```102103**RIGHT** -- Use `regex_explain`:104```105User: What does this regex do?106Agent: calls regex_explain → "Password validator: requires at least 1 uppercase letter (lookahead 1), 1 digit (lookahead 2), 1 special char from !@#$% (lookahead 3), minimum 8 characters total from allowed set"107```108109---110111### `regex_build` -- Natural Language to Regex (PatternForge)112113Describe what you want to match in plain English. Get a production-ready regex with recommended flags, explanation, and test cases (both positive and negative).114115| Parameter | Type | Default | Description |116|-----------|------|---------|-------------|117| `description` | string | required | Plain English description of what to match |118| `options` | object | {} | `strict: boolean` for anchored patterns, `examples: string[]` for guidance |119120**Output**: `{ pattern, flags, explanation, testCases: { shouldMatch: [], shouldNotMatch: [] } }`121122**Example**: Input "match email addresses" produces a complete RFC-5322-lite pattern with 5 positive and 5 negative test cases.123124---125126### `regex_library` -- Pattern Collection (BattleTest Library)127128Browse 50+ curated, production-tested regex patterns organized by category. Every pattern includes the regex string, description, recommended flags, and positive/negative test cases.129130| Parameter | Type | Default | Description |131|-----------|------|---------|-------------|132| `category` | string | "" | Filter by category: `email`, `url`, `ip`, `phone`, `date`, `uuid`, `jwt`, `credit_card`, `password`, `html`, `file_path`, `css` |133| `search` | string | "" | Free-text search across pattern names and descriptions |134135**Categories**: email, URL, IPv4, IPv6, phone (US, UK, JP, international), date (ISO, US, EU), UUID (v1-v5), JWT, credit card (Visa, MC, Amex), password strength, HTML tags, file paths (Unix, Windows), CSS selectors, color codes, semantic versioning.136137---138139### `regex_replace` -- Find & Replace (SmartReplace Engine)140141Perform regex-based find-and-replace with full capture group reference support ($1, $2, named groups), global and first-match modes.142143| Parameter | Type | Default | Description |144|-----------|------|---------|-------------|145| `pattern` | string | required | Regex pattern to find |146| `replacement` | string | required | Replacement string with `$1`, `$2`, `$<name>` references |147| `text` | string | required | Input text to transform |148| `flags` | string | "g" | Regex flags |149150**Output**: `{ result, replacementCount, diff: { before, after } }`151152**Supports**: `$1`-`$9` numbered backreferences, `$<name>` named backreferences, `$&` full match, `` $` `` pre-match, `$'` post-match.153154## What NOT to Do155156| Don't | Why | Do Instead |157|-------|-----|------------|158| Use catastrophic backtracking patterns like `(a+)+$` | Will timeout on edge workers (~50ms limit) | Rewrite with atomic groups or possessive quantifiers |159| Expect PCRE-only features (conditional patterns, recursion) | Uses JavaScript ES2024 regex engine | Stick to JS-compatible syntax |160| Send input text over 100KB | Memory limits on edge workers | Split large texts into chunks |161| Rely on patterns for security validation alone | Regex is for format checking, not sanitization | Combine with server-side validation |162| Use `regex_build` for complex parsers | NL-to-regex handles single patterns, not grammars | Build complex patterns manually with `regex_explain` to verify |163164## Security & Privacy165166| What | Status |167|------|--------|168| Reads your input text and patterns | Yes -- for processing only |169| Stores your data | **No** -- zero persistence, stateless edge processing |170| Sends data to third parties | **No** -- processed entirely on Cloudflare Workers |171| Logs request content | **No** -- only anonymous usage counters |172| Executes patterns server-side | Yes -- sandboxed with 50ms timeout to prevent ReDoS |173| Requires authentication | Free tier: no. Pro: API key header only |174175## Pricing176177| Tier | Calls/Day | Price | What You Get |178|------|-----------|-------|--------------|179| Free | 20 | $0 | All 5 regex tools, no signup |180| Pro | 1,000 | $9/mo | All 9 OpenClaw servers (49 tools), priority routing |181| x402 | Pay-per-call | $0.05 USDC | No account needed, crypto-native |182183**Get Pro Key**: https://buy.stripe.com/4gw5na5U19SP9TW288184185## The OpenClaw Intelligence Stack186187| Server | Tools | Best For |188|--------|-------|----------|189| **JSON Toolkit** | 6 | Format, validate, diff, query, transform JSON |190| **Regex Engine** | 5 | Test, extract, replace, explain regex patterns |191| **Color Palette** | 5 | Generate, convert, harmonize, accessibility-check colors |192| **Timestamp Converter** | 5 | Parse, format, diff, timezone-convert timestamps |193| **Prompt Enhancer** | 6 | Optimize, rewrite, score, A/B test AI prompts |194| **Market Intelligence** | 6 | AI market trends, GitHub stats, competitor analysis |195| **Fortune & Tarot** | 3 | Daily fortune, tarot readings, I Ching |196| **Content Publisher** | 8 | MoltBook posts, social content, newsletter |197| **AgentForge Compare** | 5 | Compare AI tools, frameworks, MCP servers |198199All 9 servers share one Pro key. **$9/mo = 49 tools.**