StringMatcher
type.matcher.StringMatcher
[type.matcher.StringMatcher proto]
Specifies the way to match a string.
{
"exact": "...",
"prefix": "...",
"suffix": "...",
"regex": "...",
"safe_regex": "{...}"
}
exact
(string) The input string must match exactly the string specified here.
Examples:
- abc only matches the value abc.
Precisely one of exact, prefix, suffix, regex, safe_regex must be set.
prefix
(string) The input string must have the prefix specified here. Note: empty prefix is not allowed, please use regex instead.
Examples:
- abc matches the value abc.xyz
Precisely one of exact, prefix, suffix, regex, safe_regex must be set.
suffix
(string) The input string must have the suffix specified here. Note: empty prefix is not allowed, please use regex instead.
Examples:
- abc matches the value xyz.abc
Precisely one of exact, prefix, suffix, regex, safe_regex must be set.
regex
(string) The input string must match the regular expression specified here. The regex grammar is defined here.
Examples:
The regex
\d{3}
matches the value 123The regex
\d{3}
does not match the value 1234The regex
\d{3}
does not match the value 123.456
Attention
This field has been deprecated in favor of safe_regex as it is not safe for use with untrusted input in all cases.
Precisely one of exact, prefix, suffix, regex, safe_regex must be set.
safe_regex
(type.matcher.RegexMatcher) The input string must match the regular expression specified here.
Precisely one of exact, prefix, suffix, regex, safe_regex must be set.
type.matcher.ListStringMatcher
[type.matcher.ListStringMatcher proto]
Specifies a list of ways to match a string.
{
"patterns": []
}
patterns
(type.matcher.StringMatcher, REQUIRED)