content/flux/v0/stdlib/regexp/matchregexpstring.md
regexp.matchRegexpString() tests if a string contains any match to a regular expression.
(r: regexp, v: string) => bool
{{% caption %}} For more information, see Function type signatures. {{% /caption %}}
({{< req >}})
Regular expression used to search v.
({{< req >}}) String value to search.
import "regexp"
regexp.matchRegexpString(r: /(gopher){2}/, v: "gophergophergopher")// Returns true
import "regexp"
import "sampledata"
sampledata.string()
|> filter(fn: (r) => regexp.matchRegexpString(r: /_\d/, v: r._value))