regen 0.1.0

A library and command-line tool for generating all strings matching a regular expression
Documentation
  • Coverage
  • 87.5%
    7 out of 8 items documented4 out of 6 items with examples
  • Size
  • Source code size: 63.01 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.79 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 16s Average build duration of successful builds.
  • all releases: 16s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • afrantzis/regen
    2 1 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • afrantzis

regen

regen is a Rust library and command-line tool for generating all strings matching a regular expression.

Documentation

The detailed module documentation, including code examples for all features, can be found at https://docs.rs/regen.

Command-line tool usage

Usage: regen [options] <pattern>

Options:
    -m, --max-length LENGTH
                        The maximum number of elements (characters or bytes)
                        in the generated strings
    -c, --count         Print out the count of generated strings instead of
                        the strings themselves

Library usage

To use the regen library add the following to your Cargo.toml:

[dependencies]
regen = "0.1"

A quickstart example:

// Uncomment the following when using the older Rust 2015 edition:
// extern crate regen;

use regen::{Generator, Result};

fn main() -> Result<()> {
    let mut out = Vec::new();
    let mut gen = Generator::new("[a-z]{2}")?;
    while gen.append_next(&mut out).is_some() {
        // Process 'out'...
        // and possibly out.clear() depending on the scenario.
    }

    Ok(())
}

License

This project is licensed under the Mozilla Public License Version 2.0 (LICENSE or https://www.mozilla.org/en-US/MPL/2.0/).