// containsPatterns checks, if the channel contains a pattern
// to subscribe to or unsubscribe from multiple channels.
975161
func containsPattern(channel interface{}) bool {
	ch := channel.(string)
	if strings.IndexAny(ch, "*?[") != -1 {
		return true
	}
	return false
}
1301602
func (o *DeleteFqdnCacheParams) WithMatchpattern(matchpattern *string) *DeleteFqdnCacheParams {
	o.SetMatchpattern(matchpattern)
	return o
}
725082
func (s *WebhookFilter) SetExcludeMatchedPattern(v bool) *WebhookFilter {
	s.ExcludeMatchedPattern = &v
	return s
}
681807
func NewPattern(pattern string) Pattern {
	switch {
	case strings.HasPrefix(pattern, semverPrefix):
		pattern = strings.TrimPrefix(pattern, semverPrefix)
		c, _ := semver.NewConstraint(pattern)
		return SemverPattern{pattern, c}
	case strings.HasPrefix(pattern, regexpPrefix):
		pattern = strings.TrimPrefix(pattern, regexpPrefix)
		r, _ := regexp.Compile(pattern)
		return RegexpPattern{pattern, r}
	case strings.HasPrefix(pattern, regexpAltPrefix):
		pattern = strings.TrimPrefix(pattern, regexpAltPrefix)
		r, _ := regexp.Compile(pattern)
		return RegexpPattern{pattern, r}
	default:
		return GlobPattern(strings.TrimPrefix(pattern, globPrefix))
	}
}
1301381
func (set StringSet) ContainsAll(i ...string) bool {
	allSet := NewStringSetFromSlice(i)
	if allSet.IsSubset(set) {
		return true
	}
	return false
}
587467
func (g *Grok) addPatternsFromMap(m map[string]string) error {
	patternDeps := graph{}
	for k, v := range m {
		keys := []string{}
		for _, key := range canonical.FindAllStringSubmatch(v, -1) {
			names := strings.Split(key[1], ":")
			syntax := names[0]
			if g.patterns[syntax] == nil {
				if _, ok := m[syntax]; !ok {
					return fmt.Errorf("no pattern found for %%{%s}", syntax)
				}
			}
			keys = append(keys, syntax)
		}
		patternDeps[k] = keys
	}
	order, _ := sortGraph(patternDeps)
	for _, key := range reverseList(order) {
		g.addPattern(key, m[key])
	}

	return nil
}
1053961
func (tc *WildcardTopicsToNumStreams) Pattern() string {
	switch tc.TopicFilter.(type) {
	case *WhiteList:
		return whiteListPattern
	case *BlackList:
		return blackListPattern
	default:
		panic("unknown topic filter")
	}
}
1157879
func (s *OrderedSet) ContainsAll(i ...string) bool {
	for _, item := range i {
		if !s.Contains(item) {
			return false
		}
	}
	return true
}
955630
func ReplacePattern(str, pattern, replace string) string {
	r, _ := regexp.Compile(pattern)
	return r.ReplaceAllString(str, replace)
}
76239
func (s *CreateGrokClassifierRequest) SetCustomPatterns(v string) *CreateGrokClassifierRequest {
	s.CustomPatterns = &v
	return s
}
67785
func treeCanMatchPattern(pattern string) func(name string) bool {
	wildCard := false
	if i := strings.Index(pattern, "..."); i >= 0 {
		wildCard = true
		pattern = pattern[:i]
	}
	return func(name string) bool {
		return len(name) <= len(pattern) && hasPathPrefix(pattern, name) ||
			wildCard && strings.HasPrefix(name, pattern)
	}
}
651837
func (s *CaptionFormat) SetPattern(v string) *CaptionFormat {
	s.Pattern = &v
	return s
}
674977
func (s *Statement) SortedGraphPatternClauses() []*GraphClause {
	var ptrns []*GraphClause
	// Filter empty clauses.
	for _, cls := range s.pattern {
		if cls != nil && !cls.IsEmpty() {
			ptrns = append(ptrns, cls)
		}
	}
	sort.Sort(bySpecificity(ptrns))
	return ptrns
}
817575
func MatchPattern(pattern string) MatcherFunc {
	r := regexp.MustCompile(pattern)
	return func(candidate string) bool {
		return r.MatchString(candidate)
	}
}
770186
func (g *Grok) addPattern(name, pattern string) error {
	dnPattern, ti, err := g.denormalizePattern(pattern, g.patterns)
	if err != nil {
		return err
	}

	g.patterns[name] = &gPattern{expression: dnPattern, typeInfo: ti}
	return nil
}
273663
func (s StringSet) Contains(v string) bool {
	_, ok := s[v]
	return ok
}
1346195
func (s *sqlStatement) MatchPatterns(str string) bool {
	for _, pattern := range s.patterns {
		if !pattern.MatchString(str) {
			return false
		}
	}
	return true
}