{"uid":"cap_2J6aJ6VgDw5-7ry2GgvFl","slug":"re2-regex-test-openverbs-85e575a0","name":"RE2 Regex Test (openverbs)","description":"Test whether a RE2 pattern matches anywhere in the input. Returns { matched }. RE2 guarantees linear-time evaluation, so this is safe against catastrophic backtracking. An invalid pattern is a clean 400; no match is a successful 200.","url":"https://regex.openverbs.com/v1/test","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["pattern","input"],"properties":{"flags":{"type":"string","maxLength":8,"description":"Any of i (case-insensitive), m (multiline ^$), s (dotall). Default none."},"input":{"type":"string","maxLength":1000000,"description":"The subject text."},"pattern":{"type":"string","maxLength":4096,"minLength":1,"description":"RE2 regular-expression pattern."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004","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.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_iRXi8KwfM-xyO2-KIkNrE","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Tests whether a RE2 regular-expression pattern matches anywhere in an input string, returning a boolean matched result with linear-time safety guarantees.","exampleAgentPrompt":"Check if this text contains a valid ISO 8601 date somewhere — use the RE2 pattern `\\d{4}-\\d{2}-\\d{2}` and test it against: 'The event is scheduled for 2024-07-15 at the main venue.'","exampleUseCases":[{"title":"Email format validation in pipeline","prompt":"Test whether the string 'user.name+tag@example.co.uk' contains a match for the RE2 pattern `[a-zA-Z0-9._%+\\-]+@[a-zA-Z0-9.\\-]+\\.[a-zA-Z]{2,}` — I need to know if it looks like a valid email address."},{"title":"Log line keyword detection","prompt":"I have a server log line: 'ERROR 2024-07-15T10:23:01Z upstream connection refused on port 8080'. Check if the pattern `(?i)error|exception|fatal` matches anywhere in it so I can flag it for alerting."},{"title":"Multiline pattern check in document","prompt":"I've got a multi-line config file block and I want to know if any line starts with 'server_name'. Use the RE2 pattern `^server_name` with multiline mode enabled and test it against my text."}],"resultDescription":"A JSON object with a single boolean field `matched` — true if the RE2 pattern was found anywhere in the subject text, false if no match was found. An invalid RE2 pattern returns a 400 error with a description of the parse failure.","failureModes":["Invalid RE2 pattern syntax returns HTTP 400 with a descriptive error message","Input text exceeding 1,000,000 characters will be rejected","Pattern exceeding 4,096 characters will be rejected","Unsupported regex flags (only i, m, s are valid) may cause a 400","Payment required (402) if x402 micropayment header is missing or invalid"],"whenToPreferThis":"Choose this endpoint when you need a safe, guaranteed linear-time regex match test — especially when the pattern or input is untrusted or large, making catastrophic backtracking (ReDoS) a concern. Prefer it over PCRE-based alternatives when you only need a yes/no match result and want RE2 semantics. It is ideal for validation steps in automated pipelines where a simple boolean answer is sufficient.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:34:21.387Z","isFirstParty":false}