Crates.io | goglob |
lib.rs | goglob |
version | 0.2.0 |
source | src |
created_at | 2022-04-15 16:14:28.618621 |
updated_at | 2022-04-15 16:14:28.618621 |
description | Shell pattern matching similar to golang's path.Match |
homepage | https://github.com/hugo-cuenca/goglob/ |
repository | https://github.com/hugo-cuenca/goglob/ |
max_upload_size | |
id | 568551 |
size | 3,651 |
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.
proc-macro
: allows using the glob!("<PATTERN>")
procedural macro (see
glob!()
).serde
: enables serde deserialization of string patterns.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.