regexp.findStringIndex() function
regexp.findStringIndex()
returns a two-element array of integers that represent the
beginning and ending indexes of the first regular expression match in a string.
Function type signature
(r: regexp, v: string) => [int]
Parameters
r
(Required)
Regular expression used to search v
.
v
(Required) String value to search.
Examples
Index the bounds of first regular expression match in each row
import "regexp"
regexp.findStringIndex(r: /ab?/, v: "tablet")// Returns [1, 3]
Was this page helpful?
Thank you for your feedback!
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, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.