regexp.compile() function

regexp.compile() parses a string into a regular expression and returns a regexp type that can be used to match against strings.

Function type signature
(v: string) => regexp
For more information, see Function type signatures.



(Required) String value to parse into a regular expression.


Convert a string into a regular expression

import "regexp"

regexp.compile(v: "abcd")// Returns the regexp object /abcd/

Was this page helpful?

Thank you for your feedback!

Introducing InfluxDB 3.0

The new core of InfluxDB built with Rust and Apache Arrow. Available today in InfluxDB Cloud Dedicated.

Learn more

State of the InfluxDB Cloud Serverless documentation

The new documentation for InfluxDB Cloud Serverless is a work in progress. We are adding new information and content almost daily. Thank you for your patience!

If there is specific information you’re looking for, please submit a documentation issue.