What is this tool?
A regex generator from text helps you turn example log lines, IDs, URLs, CSV-like rows, or plain text snippets into regular expression candidates. Paste a large file, add one or more strings that should match, and Spoold suggests patterns that you can test against the source without uploading data.
This is different from a regex tester. The Regex Tester is best when you already have a pattern. The Regex Generator & Pattern Finder starts from examples, detects token shapes, creates candidate regexes, and scans the text for matching lines.
Workflow
- Paste or upload a text file, log file, CSV export, or raw text sample.
- Add one or more positive examples that must match.
- Add optional negative examples that must not match.
- Generate regex candidates and compare loose, balanced, strict, and extractor patterns.
- Scan the source text, review matching lines, and copy or open the regex in the Regex Tester.
Log regex generator
Log lines often combine stable labels with variable values. The generator recognizes common tokens such as timestamp, date, time, ip, uuid, email, url, path, number, and quoted strings.
| Input shape | Generated idea |
|---|
| 2026-06-13 09:13:02 | Timestamp capture with date and time shape. |
| user_id=9281 | Literal key plus a named numeric capture. |
| path=/api/orders | Literal key plus a path capture. |
| request_id=uuid | UUID shape with a named group when the key is visible. |
Positive and negative examples
One example can only produce a guess. Add multiple must-match examples when possible, then add a few must-not-match lines to make the pattern less broad. The confidence score rewards candidates that match positives and avoid negatives.
Generated regex types
- Balanced keeps stable text literal and captures variable values such as IDs, dates, paths, and statuses.
- Loose generalizes more text to find similar lines in noisy logs or inconsistent exports.
- Strict stays closest to the sample while still allowing flexible whitespace and numeric values.
- Extractor removes line anchors so the pattern can find a matching substring inside longer lines.
Large file scanning
Scanning is manual and chunked. The tool processes lines in batches, updates progress, and previews the first set of matches instead of continuously rerunning on every keystroke. That keeps log regex generation usable for large pasted files and uploaded text files.
Limits
- Regex generation is inference, not proof. Always test the candidate on real positives and negatives.
- JavaScript regular expressions are used, so PCRE-only features may not work.
- Highly irregular text may need manual edits in the Regex Tester after generation.
- For structured JSON, XML, or CSV data, a parser is usually safer than regex extraction.
FAQ
Can this generate regex from one example?
Yes, but one example is only a starting point. Add more positive and negative examples to make the pattern more reliable.
Does this upload my log file?
No. The generation and scanning run in your browser.
Can I edit the generated regex?
Yes. Copy it or open it in the Regex Tester to refine flags, groups, anchors, and replacements.
What regex flavor does it generate?
JavaScript / ECMAScript regular expressions, including named capture groups when supported by the browser.
Already have a pattern? Open the Regex Tester to debug matches, flags, capture groups, and replacements.