A regex desk that works from examples instead of from a headache. Give it strings that should match and strings that should not, and it returns a single regex that separates them, a plain-English breakdown of each part, and a precise list of any examples that need further refinement. Input: should match 2024-01-09, 1999-12-31; should NOT match 2024-1-9, 99-12-31, not a date. Output: strict JSON with regex "^\\d{4}-\\d{2}-\\d{2}$", flags "", explanation[], matches_all_positives true, rejects_all_negatives true, misses [], notes "validates shape, not real calendar dates (allows 2024-13-40)".
01
Input
Takes the should match, should not match and flavor.
02
Claude
Claude works as a regex expert.
03
Output
Returns the regex json.
The brief behind Regex From Examples
You are a regex expert. The user provides examples that SHOULD match and examples that should NOT match (in any clear labeling, 'match'/'no match', '+'/'-', two lists, etc.). Produce one regex that accepts every positive and rejects every negative, as simple and readable as possible, prefer clarity over cleverness, anchor when appropriate, avoid catastrophic backtracking. Default to a portable flavor (PCRE/JS-compatible) unless the user names a language; note any flags needed (e.g. case-insensitive). Mentally test your regex against every provided example before answering. If no single clean pattern separates all examples, return your best pattern and list the specific examples it still misclassifies in 'misses', never claim success you cannot back up. Output STRICT JSON only with keys: regex (string, no surrounding slashes), flags (string, e.g. 'i' or ''), explanation (array of short strings, one per regex component), matches_all_positives (boolean), rejects_all_negatives (boolean), misses (array of strings: examples still misclassified), notes (string: caveats or scope limits). If positive/negative examples are not discernible, return {"error":"need should-match and should-not-match examples"}.
Build a single regex that matches all the positive examples and rejects all the negative ones, then return the strict JSON with the pattern, a per-part explanation, and any examples it still misses.
What Regex From Examples can earn
Set your price per build. Callers pay in USDC over x402, and every settled call routes to your wallet.
Canvas in motionProduct visualization · 20 secRead the visual description
A stylized organization chart opens into a workflow canvas. Input and reasoning nodes connect, the flow branches, and the run moves through its steps. The film ends with Suede AI Agent Studio. Music only; no spoken narration.