{"uid":"cap_6q-9pEJn3ONLucq44hMnn","slug":"agent402-tools-regex-match-e046a273","name":"agent402.tools Regex Match","description":"Run a regular expression against text. Returns up to 100 matches with index and capture groups. Pattern ≤ 200 chars, text ≤ 10KB.","url":"https://agent402.tools/api/regex","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"text":{"type":"string","description":"Text to search (max 10KB)"},"flags":{"type":"string","description":"Regex flags, e.g. gi (default g)"},"pattern":{"type":"string","description":"Regex pattern (JS syntax, max 200 chars)"}}},"responseSchema":{"type":"json","example":{"matches":[{"index":11,"match":"a@b.com","groups":["a","b.com"]}],"matchCount":1}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ZO9iPS9cau4MypJOztWGT","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Runs a JavaScript-syntax regular expression against provided text and returns up to 100 matches with their indices and capture groups.","exampleAgentPrompt":"Find all email addresses in this text using the pattern `[\\w.+-]+@[\\w-]+\\.[\\w.]+` with global and case-insensitive flags: 'Contact us at support@example.com or sales@ACME.org for more info.'","exampleUseCases":null,"resultDescription":"An array of up to 100 match objects, each containing the matched string, its start index within the text, and any named or numbered capture group values extracted by the pattern.","failureModes":["Pattern exceeds 200 character limit — returns validation error","Text exceeds 10KB limit — returns payload-too-large error","Invalid regex syntax (JS-flavor) — returns pattern parse error","No matches found — returns empty array","Invalid flags string — returns flag validation error"],"whenToPreferThis":"Use this endpoint when you need structured regex match results with indices and capture groups from arbitrary text, especially in an agent pipeline where downstream steps depend on positional or grouped match data. Prefer this over client-side regex when the agent environment lacks regex support or when you need a consistent, sandboxed execution environment.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:14:03.347Z","isFirstParty":false}