Debian Codegraph @

pushrules/glob/README.md

raw
1 # String globbing in Go
2
3 [![GoDoc](https://godoc.org/github.com/zyedidia/glob?status.svg)](http://godoc.org/github.com/zyedidia/glob)
4
5 This package adds support for globs in Go.
6
7 It simply converts glob expressions to regexps. I try to follow the standard defined [here](http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_13).
8
9 # Example
10
11 ```go
12 package main
13
14 import "github.com/zyedidia/glob"
15
16 func main() {
17 glob, err := glob.Compile("{*.go,*.c}")
18 if err != nil {
19 // Error
20 }
21
22 glob.Match([]byte("test.c")) // true
23 glob.Match([]byte("hello.go")) // true
24 glob.Match([]byte("test.d")) // false
25 }
26 ```
27
28 You can call all the same functions on a glob that you can call on a regexp.