Why “from examples” is a different tool
Search for a regex generator and the first page is explainers, cheat sheets and “human-readable” translators. Those assume you already know what pattern you want and just need it written out. The harder moment is earlier: you have a pile of strings that should match — log IDs, ticket references, a column out of a spreadsheet — and you want the pattern, not a lecture.
That moment has a trap, and this tool is built around avoiding it: a pattern that looks plausible often matches things you never intended. So every candidate here is run back over your own text before it is offered, and the ranking says which ones reproduced your examples exactly and which ones went too far:
- Verified before suggested. Each candidate is executed against the text you pasted and compared with the occurrences of your examples. Only candidates whose hit set is exactly your examples rank first; the rest are labelled with how many extra hits they produced — and a conservative “every example as an escaped literal, joined with |” candidate is always there as the guaranteed-correct floor.
- Common parts stay literal. The prefix and suffix shared by your examples are escaped verbatim — that is where over-matching usually comes from — and only the varying middle is generalised to \d+, \w+, [0-9a-fA-F]+ or \s+.
- A shape library for the usual suspects. When a whole example is recognisably an email address, URL, UUID, IPv4 address, ISO date, time, hex colour, semantic version or JWT, the library pattern is used instead of a sequence of \w+.
- The test step is on the same screen. Hits versus expected, every hit highlighted in your own text, the segments nothing matched, and per-piece explanations of where each part of the pattern came from. You decide which candidate is good enough, and you can check it before it reaches your code.
Everything is computed in your browser: nothing is uploaded and there is no share link. The candidates use only constructs shared by JavaScript, Python, PCRE and RE2 — no backreferences and no lookaround — so the same pattern behaves the same way wherever you paste it, and the tool refuses to hide a catastrophic-backtracking risk if you edit one in yourself. Treat the output as a starting point for review, not as a spec: it induces the shape of your examples, never their meaning.