GithubHelp home page GithubHelp logo

garkgarcia / regen Goto Github PK

View Code? Open in Web Editor NEW

This project forked from afrantzis/regen

0.0 1.0 0.0 16 KB

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

License: Mozilla Public License 2.0

Rust 100.00%

regen's Introduction

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/).

regen's People

Contributors

garkgarcia avatar afrantzis avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.