Skip to content

Latest commit

 

History

History
48 lines (30 loc) · 1.35 KB

README.md

File metadata and controls

48 lines (30 loc) · 1.35 KB

regexpset LicenseGo.Dev referenceTravisCIGo Report Card

What is it?

regexpset is an extension to Go standard library regexp. It contains a set of regular expression patterns and provides methods for matching on input string.

Basic example

    
    import "github.com/sugarme/regexpset"

    func main(){
        var patterns []string = []string{
            `\w+`,
            `\d+`,
            `\pL+`,
            `foo`,
            `bar`,
            `barfoo`,
            `foobar`,
        }

        set, err := regexpset.NewRegexpSet(patterns)
        if err != nil {
            log.Fatal(err)
        }

        setmatches := set.Matches("foobar")

        fmt.Println(setmatches.Matches())

        // [0 1 2 3 4 6]
    }
   

Documentation

See Go.Dev Reference

License: Apache 2.0