Documentation ¶
Index ¶
- func FindStringSubmatchNamedMap(rx *regexp.Regexp, s string) map[string]string
- func McReplaceAllString(pattern string, s string, repl string) string
- type RegexpSet
- func (set *RegexpSet) FindAllString(pattern string, s string, n int, useStore bool, key string) []string
- func (set *RegexpSet) FindAllStringSubmatch(pattern string, s string, n int, useStore bool, key string) [][]string
- func (set *RegexpSet) FindStringSubmatch(pattern string, s string, useStore bool, key string) []string
- func (set *RegexpSet) GetRegexp(pattern string, useStore bool, key string) *regexp.Regexp
- type StringMatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RegexpSet ¶
RegexpSet is a struct that holds compiled regular expressions. Primary goals of this struct is to reduce MustCompile regular expressions into a single function call and to store the compiled regular expressions if desired
func NewRegexpSet ¶
func NewRegexpSet() RegexpSet
func (*RegexpSet) FindAllString ¶
func (*RegexpSet) FindAllStringSubmatch ¶
func (set *RegexpSet) FindAllStringSubmatch(pattern string, s string, n int, useStore bool, key string) [][]string
FindAllStringSubmatch performs a regular expression find against the supplied pattern and string. It will store the compiled regular expression for later use.
func (*RegexpSet) FindStringSubmatch ¶
type StringMatcher ¶
StringMatcher provides the ability to match a string against multiple regular expressions with a pre-formatting function as well.
func NewStringMatcher ¶
func NewStringMatcher() StringMatcher
NewStringMatcher returns a new StringMatcher instance.
func (*StringMatcher) AddMatcher ¶
func (sm *StringMatcher) AddMatcher(rx *regexp.Regexp)
AddMatcher adds a regular expression to attempt to match against.
func (*StringMatcher) Match ¶
func (sm *StringMatcher) Match(input string) bool
Match runs the provided string against the prematch function and regular expresssions, returning true if any of the expressions match.