regexp.matchRegexpString() function
The regexp.matchRegexpString()
function tests if a string contains any match
to a regular expression.
Output data type: Boolean
import "regexp"
regexp.matchRegexpString(r: /(gopher){2}/, v: "gophergophergopher")
// Returns true
Parameters
r
The regular expression used to search v
.
v
The string value to search.
Examples
Filter by columns that contain matches to a regular expression
import "regexp"
data
|> filter(fn: (r) => regexp.matchRegexpString(r: /Alert:/, v: r.message))
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, the following resources are available:
InfluxDB Cloud customers can contact InfluxData Support.