What PatternForge does
Paint the text you want to match green and the text you don't want red. PatternForge infers a short regular expression from those examples, explains it in plain English, and hands you runnable code for JavaScript, Python, Go, and grep. The URL is the save file. It runs entirely in your browser.
The agent
Example-based regex inference is underdetermined - a naive tool can confidently emit a wrong pattern. PatternForge instead runs a bounded propose -> test -> repair agent loop, in the browser, no model in the trust path: it proposes a candidate, tests it as a real RegExp against every green and red example, and repairs on failure - only surfacing a pattern that passes all examples, or honestly saying no consistent pattern exists. That act-observe-repair loop is shown live in the UI.
Correctness
It can no longer emit a pattern that contradicts your examples. Cross-dialect output is validated: Go (RE2) and grep (POSIX ERE) refuse to emit backreferences/lookaround they can't express, grep gets faithful rewrites, and catastrophic-backtracking (ReDoS) shapes are flagged.
How we built it
TypeScript, browser-only, dependency-free. 46 tests green (node run-tests.mjs). Built and adversarially judged with amini-code's multi-agent loop.
Built With
- css
- html
- regex
- typescript
Log in or sign up for Devpost to join the conversation.