match

package
v5.6.3+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2017 License: Apache-2.0 Imports: 7 Imported by: 1,091

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExactMatcher

type ExactMatcher struct {
	// contains filtered or unexported fields
}

func CompileExact

func CompileExact(pattern string) (ExactMatcher, error)

func MustCompileExact

func MustCompileExact(pattern string) ExactMatcher

func (*ExactMatcher) MatchAllStrings

func (m *ExactMatcher) MatchAllStrings(strs []string) bool

func (*ExactMatcher) MatchAnyString

func (m *ExactMatcher) MatchAnyString(strs []string) bool

func (*ExactMatcher) Unpack

func (m *ExactMatcher) Unpack(s string) error

type Matcher

type Matcher struct {
	// contains filtered or unexported fields
}

func Compile

func Compile(pattern string) (Matcher, error)

Compile regular expression to string matcher. String matcher by default uses regular expressions as provided by regexp library, but tries to optimize some common cases, replacing expensive patterns with cheaper custom implementations or removing terms not necessary for string matching.

func CompileString

func CompileString(in string) (Matcher, error)

CompileString matches a substring only, the input is not interpreted as regular expression

func MustCompile

func MustCompile(pattern string) Matcher

func (*Matcher) MatchAllStrings

func (m *Matcher) MatchAllStrings(strs []string) bool

func (*Matcher) MatchAnyString

func (m *Matcher) MatchAnyString(strs []string) bool

func (*Matcher) Unpack

func (m *Matcher) Unpack(s string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL