RegexEscape

Copied!
( value )

Description

The RegexEscape function returns an escaped regular expression that matches the value string verbatim. The returned regular expression is simply the value string surrounded by the \Q and \E escape sequences.

Parameters

Parameter Type Definition and Requirements

value

The String to convert to an escaped regular expression.

Returns

Returns a regular expression String.

Examples

The following query converts a string into an escaped regular expression:

Copied!
('.Fa*[un]a{1,}')
'\\Q.Fa*[un]a{1,}\\E'
Query metrics:
  •    bytesIn:  31

  •   bytesOut:  34

  • computeOps:   1

  •    readOps:   0

  •   writeOps:   0

  •  readBytes:   0

  • writeBytes:   0

  •  queryTime: 2ms

  •    retries:   0

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!