| Crates.io | rexgen |
| lib.rs | rexgen |
| version | 0.1.0 |
| created_at | 2025-10-03 15:54:45.547095+00 |
| updated_at | 2025-10-03 15:54:45.547095+00 |
| description | A fast CLI to generate text that matches regex-like patterns. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1866854 |
| size | 76,604 |
A fast CLI to generate text that matches regex-like patterns. Inspired by the original TDG tool, rexgen focuses on a cleaner pattern syntax, intuitive CLI flags, and a high-performance Rust core.
\d{5}, [A-Z]{2,4}, groups, ranges, repetition).{{ ... }}, replacing each with generated content.--seed and bulk generation via --count.pattern <expr> Generate strings from a single pattern expression (no free text). Default behavior: pattern is assumed if the mode is omitted.template <file> Processes the provided template file containing {{ ... }} placeholders.list List available pattern names (with namespace) from loaded libraries; marks entries that contain placeholders.--count, -c <n> Number of items to produce (default 1). Each item is one full pattern expansion or a full template render.--output, -o <path> Write results to a file instead of stdout.--separator <sep> Separator to join multiple outputs when --count > 1 (default: newline). Note: this controls output joining and is unrelated to [lib].delims in .rxlib files.--seed, -s <n> Seed for deterministic generation (same inputs => same outputs).--lib, -l <file> Load a pattern library file. Repeatable.--lib-dir, -I <dir> Add a directory to the library search path. Repeatable.--strict Treat unknown named-patterns as fatal (default: unknown treated as literal where safe).--verbose, -v Increase verbosity; -vv for more. --quiet, -q to suppress non-errors.--help, -h Show help. --version, -V Show version.--jobs <n> Set the parallel worker count while keeping deterministic ordering with --seed.rexgen "My SSN is '{{@us:ssn}}'." --lib us-data.rxlib --count 100 --seed 42 Generate 100 SSN-like values from a named entry, deterministically.rexgen '[1-9]\d\d-\d\d-\d\d\d\d' --count 5 Generate 5 SSN-like values from a raw expression.rexgen template template.txt --lib names.rxlib --count 10 --output out.txt Render template.txt ten times using names from names.rxlib.rexgen pattern '[A-Z]{3}' --count 5 --separator ', ' Inline pattern rendered five times, joined by a comma+space.rexgen list --lib us-data.rxlib List all named patterns in the provided lib.rexgen list --lib-dir ./patterns List all named patterns in the provided directory.{{ pattern }} placeholders.[lib] metadata and a single [patterns] table. --lib loads files; --lib-dir adds search paths; --list enumerates loaded names.--output to write to a file.docs/rexgen-language.md.--seed guarantees identical outputs for identical inputs.--jobs) remains deterministic: worker RNGs derive from the master seed so ordering and content are stable across runs and platforms.--count > 1, outputs are joined with --separator (default newline) and no trailing separator is written.namespace and pattern keys are case-sensitive. Use {{@ns:name}} inside placeholders to reference across namespaces.--lib-dir in order, then the current working directory../rexgen-patterns.See Language Reference for library file structure ([lib], [patterns]), placeholder delimiters ([lib].delims), and inline placeholders in values.