Skip to content

Releases: trananhtung/brace-expansion

brace-expansion v0.1.0

Choose a tag to compare

@trananhtung trananhtung released this 22 Jun 07:17

First release.

Bash-style brace expansion — a faithful Rust port of the brace-expansion npm package (the expander behind minimatch/glob).

use brace_expansion::expand;
assert_eq!(expand("a{b,c}d"), ["abd", "acd"]);
assert_eq!(expand("{1..3}"), ["1", "2", "3"]);
assert_eq!(expand("{01..03}"), ["01", "02", "03"]);
assert_eq!(expand("a{b,c{d,e}}f"), ["abf", "acdf", "acef"]);
  • expand(pattern) / expand_with_max(pattern, max); EXPANSION_MAX
  • Comma sets, numeric & alphabetic sequences (steps + zero-padding), nesting, escaping, bash quirks
  • Zero dependencies; #![no_std]

Differential-tested against the real node brace-expansion v5 (0 mismatches over 10000+ patterns) and spot-checked vs bash. Hardened by an adversarial review (overflow-safe sequences, recursion-depth guard verified to 200k levels).

Fills a real gap — brace-expansion/balanced-match had no current Rust equivalent.

📦 https://crates.io/crates/brace-expansion