$ man regex-from-prompt
/regex-from-prompt(1)
NAME
regex-from-prompt — regex generator / nl to regex / pattern builder
SYNOPSIS
POST https://x402.org/v1/regex-from-prompt
Content-Type: application/json
X-PAYMENT: <signed-transferWithAuthorization>
{ ... }↳ first call →
402 Payment Required. Sign USDCtransferWithAuthorization, retry with theX-PAYMENT header.DESCRIPTION
Regex generator / NL to regex / pattern builder. PCRE / JavaScript / Python / Go / RE2. Returns pattern + flags + explanation + 3-6 test examples. Live-runs JS regex on sample_text.
INPUT — request schema
| property | type | description | req? |
|---|---|---|---|
| prompt | string | Natural-language description of the pattern to generate, e.g. 'match US phone numbers with optional country code'. | required |
| flavor | string | Target regex flavor: pcre, javascript, python, or go (RE2). enum: pcre · javascript · python · go · re2 | optional |
| sample_text | string | If provided, regex is run live (JS only). | optional |
| flags | string | Optional flags to apply, e.g. 'gi' or 'ims'; defaults inferred from prompt if omitted. | optional |
OUTPUT — response shape
| field | type | description |
|---|---|---|
| pattern | string | Generated regex pattern body, without delimiters, ready to drop into the chosen flavor. |
| flags | string | Flag string applied to the pattern, e.g. 'gi', 'm', or empty if none. |
| flavor | string | Regex flavor the pattern targets: pcre, javascript, python, or go. |
| explanation | string | Plain-English breakdown of what each part of the pattern matches. |
| test_examples | array | 3-6 sample strings labeled match or no-match showing intended behavior. |
| caveats | array | Known edge cases, flavor-specific gotchas, or inputs the pattern won't handle. |
| live_matches | array | Actual matches found when the JS pattern is run against sample_text, with indices and captures. |
| live_error | string | Error message if the JS regex failed to compile or execute against sample_text. |
| model | string | Identifier of the LLM used to generate the pattern, e.g. claude-haiku-4-5. |
EXAMPLES — two ways to call
EXAMPLE 1 · curl
curl -X POST https://x402.org/v1/regex-from-prompt \
-H 'Content-Type: application/json' \
-d '{ }'first response =
402 Payment Required with payment requirements; sign + retry with X-PAYMENT.EXAMPLE 2 · mcp
# install once claude mcp add x402 --command "npx x402-deployer-mcp" # then ask Claude Code: # "use the regex-from-prompt tool to ..."
MCP server handles payment automatically — your coding agent just calls the tool by name.
METADATA
- tags
- regexdeveloperaipattern
- env
- VENICE_API_KEY
- methods
- POST
- cluster
- wordmint
- price
- $0.01 USDC per call
ADJACENT — other endpoints in wordmint
| endpoint | description | price |
|---|---|---|
| ai-to-human-text | AI text humanizer / GPT detector bypass. | $0.01 |
| citation-verify | Citation verifier / fact-check against URL / does-this-source-support-this-claim / hallucination detector. | $0.01 |
| commit-message-from-diff | Git commit message generator / Conventional Commits / AI commit-msg. | $0.01 |
| humanize | AI text humanizer / GPT detector bypass. | $0.01 |
| sentiment | Sentiment + emotion analyzer. | $0.01 |
| sentiment-analysis | Sentiment analyzer / emotion classifier / aspect-based sentiment. | $0.01 |
| structured-extract | Structured-data extractor / JSON-from-text / schema-guided extraction / key-value pull / form-filler. | $0.01 |
| summarize | AI summarizer / TLDR generator. | $0.01 |
SEE ALSO