Golang matching

From wikinotes

Documentation

path.Match (glob match) https://pkg.go.dev/path@go1.18.3#Match
regexp https://pkg.go.dev/regexp
go regex syntax https://pkg.go.dev/regexp/syntax

Match (glob)

import "path"

isTrue := path.Match("f*", "foo")  // glob match

Regexp

import "regexp"

isTrue, err := regexp.Match("^[a-z]+$", "foobar")  // match