Skip to content

Techcable/globgroups.rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

globgroups

Expands glob groups like foo{bar,baz} -> ["foobar", "foobaz"]

Does not (currently) support wildcards like *.txt, because those are context-sensitive.

Examples

use globgroups::GlobExpr;

fn simple() {
    let glob: GlobExpr = "foo-{bar,baz}-suffix".parse().unwrap();
    assert_eq!(
        glob.expand().collect::<Vec<String>>(),
        vec![
            "foo-bar-suffix",
            "foo-baz-suffix"
        ]
    )
}

Notes

There is a pure-python version of this library globgroups.py.

There is an older (and much buggier) single-file python version in misc/globgroups.py

About

Expands glob groups like `foo{bar,baz}` -> ["foobar", "foobaz"]

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published