goglob

Crates.iogoglob
lib.rsgoglob
version0.2.0
sourcesrc
created_at2022-04-15 16:14:28.618621
updated_at2022-04-15 16:14:28.618621
descriptionShell pattern matching similar to golang's path.Match
homepagehttps://github.com/hugo-cuenca/goglob/
repositoryhttps://github.com/hugo-cuenca/goglob/
max_upload_size
id568551
size3,651
(hugo-cuenca)

documentation

README

goglob

Shell pattern matching similar to golang's path.Match.

The pattern syntax is:

pattern:
    { term }
term:
    '*'         matches any sequence of non-/ characters
    '?'         matches any single non-/ character
    '[' [ '^' ] { character-range } ']'
                character class (must be non-empty)
    c           matches character c (c != '*', '?', '\\', '[')
    '\\' c      matches character c

character-range:
    c           matches character c (c != '\\', '-', ']')
    '\\' c      matches character c
    lo '-' hi   matches character c for lo <= c <= hi

Match requires pattern to match all of name, not just a substring.

Use GlobPattern::new(pattern) to construct a new instance.

Features

  • proc-macro: allows using the glob!("<PATTERN>") procedural macro (see glob!()).
  • serde: enables serde deserialization of string patterns.

License

BSD-3-Clause.

Based in Go 1.18's path.Match (available under the BSD-3-Clause license) which contains the following comment:

// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Commit count: 2

cargo fmt