in pkg/admin/model/match.go [91:108]
func (m *StringMatch) IsMatch(input string) bool {
if m.Exact != "" && input != "" {
return input == m.Exact
} else if m.Prefix != "" && input != "" {
return strings.HasPrefix(input, m.Prefix)
} else if m.Regex != "" && input != "" {
return regexp.MustCompile(m.Regex).MatchString(input)
} else if m.Wildcard != "" && input != "" {
// only supports "*"
return input == m.Wildcard || constant.AnyValue == m.Wildcard
} else if m.Empty != "" {
return input == ""
} else if m.Noempty != "" {
return input != ""
} else {
return false
}
}