Documentation

regexp.quoteMeta() function

The regexp.quoteMeta() function escapes all regular expression metacharacters inside of a string.

Output data type: String

import "regexp"

regexp.quoteMeta(v: ".+*?()|[]{}^$")

// Returns "\.\+\*\?\(\)\|\[\]\{\}\^\$"

Parameters

v

The string that contains regular expression metacharacters to escape.

Data type: String

Examples

Escape regular expression meta characters in column values
import "regexp"

data
  |> map(fn: (r) => ({
      r with
      notes: r.notes,
      notes_escaped: regexp.quoteMeta(v: r.notes)
    })
  )

New! Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: