gomuks/lib/glob
2018-05-02 22:30:57 +03:00
..
glob.go Add tests for PushRule.Match and fork glob to make it compatible with the spec 2018-05-02 22:30:57 +03:00
LICENSE Add tests for PushRule.Match and fork glob to make it compatible with the spec 2018-05-02 22:30:57 +03:00
README.md Add tests for PushRule.Match and fork glob to make it compatible with the spec 2018-05-02 22:30:57 +03:00

String globbing in Go

GoDoc

This package adds support for globs in Go.

It simply converts glob expressions to regexps. I try to follow the standard defined here.

Example

package main

import "github.com/zyedidia/glob"

func main() {
    glob, err := glob.Compile("{*.go,*.c}")
    if err != nil {
        // Error
    }

    glob.Match([]byte("test.c"))   // true
    glob.Match([]byte("hello.go")) // true
    glob.Match([]byte("test.d"))   // false
}

You can call all the same functions on a glob that you can call on a regexp.