regexp.getString() function

The regexp.getString() function returns the source string used to compile a regular expression.

*Output data type: String*

  1. import "regexp"
  2. regexp.getString(r: /[a-zA-Z]/)
  3. // Returns "[a-zA-Z]"

Parameters

r

The regular expression object to convert to a string.

*Data type: Regexp*

Examples

Convert regular expressions into strings in each row
  1. import "regexp"
  2. data
  3. |> map(fn: (r) => ({
  4. r with
  5. regex: r.regex,
  6. regexStr: regexp.getString(r: r.regex)
  7. })
  8. )

Related articles