Regex tester
Test a regular expression against text and get match results plus text statistics - the quick validation loop for pattern development.
3 tools run server-side in one request. You pay once, settle once, and get a single response - no orchestration, no per-step payments, and a partial-success envelope if any step fails. USDC over x402 on any supported chain.
When to use this pack
A developer is writing a regex (email extraction, log parsing, URL matching) and needs to see matches + capture groups + text stats in one shot. Faster than switching between a regex tester and a word counter.
Tools in this pack
All 3 run inside the single $0.050 call above. Each is also callable on its own if you only need one part.
- Regex test POST /api/regex Run a regular expression against text. Returns up to 100 matches with index and capture groups. Pattern ≤ 200 chars, text ≤ 10KB.
- Text statistics POST /api/text-stats Characters, words, sentences, paragraphs, average word length, reading time, and an LLM token estimate for any text.
- Extract entities POST /api/extract-entities Pull emails, URLs, IPv4s, @mentions, and #hashtags out of free text. Returns deduped lists.
Workflow
- Run the regex against the text - returns all matches, capture groups, and match indices.
- Compute text-stats on the input text - word count, character count, line count. Useful context for understanding match density (e.g. 2 matches in 50 words = low density).
- Cross-check with extract-entities - the built-in deterministic extractor for emails, URLs, phone numbers, and more. Anything it finds that your pattern missed (or vice-versa) is a discrepancy in the pattern worth investigating before you ship it.
Call it directly
Any x402 client pays the 402 and gets the whole workflow back in one response:
npx agent402-client call regex-test {"pattern":"\\b\\w+@\\w+\\.\\w+\\b","text":"Contact us at hello@example.com or support@test.org"}
Run it in Claude
claude mcp add agent402 -s user -- npx -y agent402-mcp@latest
Then paste this prompt into Claude:
Test the regex \b\w+@\w+\.\w+\b against "Contact us at hello@example.com or support@test.org" using Agent402: (1) regex {pattern, text, flags:"g"} - get matches. (2) text-stats {text} - get word/char counts. (3) extract-entities {text} - cross-check against the built-in extractor. Return {matches, stats, entities}.