Documentation
¶
Index ¶
- Constants
- func CompilePattern(pattern string, escape byte) (patWeights []rune, patTypes []byte)
- func CompilePatternInner(pattern string, escape byte) (patWeights []rune, patTypes []byte)
- func Copy(src string) string
- func DoMatch(str string, patChars []rune, patTypes []byte) bool
- func DoMatchInner(str string, patWeights []rune, patTypes []byte, matcher func(a, b rune) bool) bool
- func IsExactMatch(patTypes []byte) bool
- type StringerFunc
- type StringerStr
Constants ¶
View Source
const ( // PatMatch is the enumeration value for per-character match. PatMatch = iota + 1 // PatOne is the enumeration value for '_' match. PatOne // PatAny is the enumeration value for '%' match. PatAny )
Variables ¶
This section is empty.
Functions ¶
func CompilePattern ¶
CompilePattern is a adapter for `CompilePatternInner`, `pattern` can be any unicode string.
func CompilePatternInner ¶
CompilePatternInner handles escapes and wild cards convert pattern characters and pattern types.
func DoMatchInner ¶
func DoMatchInner(str string, patWeights []rune, patTypes []byte, matcher func(a, b rune) bool) bool
DoMatchInner matches the string with patChars and patTypes. The algorithm has linear time complexity. https://research.swtch.com/glob
func IsExactMatch ¶
IsExactMatch return true if no wildcard character
Types ¶
type StringerFunc ¶
type StringerFunc func() string
StringerFunc defines string func implement fmt.Stringer.
type StringerStr ¶
type StringerStr string
StringerStr defines a alias to normal string. implement fmt.Stringer
Click to show internal directories.
Click to hide internal directories.