#string #parser-combinator #error-string #combination #permutation #parser #brace-expansion

bracoxide

A feature-rich library for brace pattern combination, permutation generation, and error handling

6 releases

new 0.1.5 Feb 16, 2025
0.1.4 Nov 10, 2024
0.1.3 Sep 20, 2023
0.1.2 Aug 7, 2023
0.1.0 Jun 21, 2023

#177 in Parser implementations

Download history 1889/week @ 2024-10-27 1775/week @ 2024-11-03 3072/week @ 2024-11-10 2094/week @ 2024-11-17 2167/week @ 2024-11-24 2635/week @ 2024-12-01 2221/week @ 2024-12-08 2139/week @ 2024-12-15 2153/week @ 2024-12-22 2849/week @ 2024-12-29 2209/week @ 2025-01-05 2172/week @ 2025-01-12 2280/week @ 2025-01-19 2369/week @ 2025-01-26 3096/week @ 2025-02-02 2992/week @ 2025-02-09

10,993 downloads per month
Used in 25 crates (3 directly)

MIT license

64KB
1.5K SLoC

{Bracoxide}

Tests License: MIT Contributor Covenant Documentation Bracoxide Crate

Bracoxide is a powerful Rust library for handling and expanding brace expansions. It provides a simple and intuitive way to generate combinations and permutations from brace patterns.

Features

  • Brace Expansion: Easily expand brace patterns into a list of all possible combinations.
  • Error Handling: Comprehensive error handling for invalid brace patterns or expansion failures.
  • MIT Licensed: Bracoxide is open-source and licensed under the MIT License.

Installation

Add Bracoxide to your Cargo.toml:

[dependencies]
bracoxide = "0.1.5"

Usage

Import the bracoxide crate and start expanding brace patterns:

use bracoxide::explode;

fn main() {
    let content = "foo{1..3}bar";
    match explode(content) {
        Ok(expanded) => {
            // [`foo1bar`, `foo2bar`, `foo3bar`]
            println!("Expanded patterns: {:?}", expanded);
        }
        Err(error) => {
            eprintln!("Error occurred: {:?}", error);
        }
    }
}

For more details and advanced usage, please refer to the API documentation.

Contributing

match contribution {
    /// found a bug or encountered an issue
    Contribution::Issue => redirect!("https://github.com/atahabaki/bracoxide/issues"),
    /// propose any changes
    Contribution::Change => redirect!("https://github.com/atahabaki/bracoxide/pulls"),
    /// have a question or need help
    Contribution::Ask => redirect!("https://github.com/atahabaki/bracoxide/discussions"),
}

Contributions are welcome! If you would like to contribute to this project, here are a few ways you can get involved:

  • Report Issues: If you encounter any issues or bugs, please let us know by creating an issue. Provide a detailed description of the problem, including steps to reproduce it if possible.
  • Propose Changes: If you have ideas for improvements or new features, we encourage you to submit a pull request. We appreciate your contributions and will review and consider them.
  • Ask Questions: If you have any questions or need help with the project, feel free to start a discussion. We'll be happy to assist you.

Please review our contribution guidelines for more detailed information on how to contribute effectively.

License

This project is licensed under the MIT License - see the LICENSE file for details.

No runtime deps