RegexEscape
RegexEscape( value )
RegexEscape( value )
RegexEscape( value )
RegexEscape( value )
regex_escape( value )
RegexEscape( 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
Argument | Type | Definition and Requirements |
---|---|---|
|
The string to convert to an escaped regular expression. |
Examples
The following query converts a string into an escaped regular expression:
Value result = await client.Query(
RegexEscape(".Fa*[un]a{1,}")
);
IResult<Value> data = result.To<Value>();
data.Match(
Success: value => Console.WriteLine($"{value}"),
Failure: error => Console.WriteLine($"Query failed:\n{error}")
);
StringV(\Q.Fa*[un]a{1,}\E)
result, err := client.Query(
f.RegexEscape(".Fa*[un]a{1,}"))
if (err != nil) {
fmt.Println(err)
} else {
fmt.Println(result)
}
\Q.Fa*[un]a{1,}\E
System.out.println(
client.query(
RegexEscape(".Fa*[un]a{1,}")
).get()
);
"\Q.Fa*[un]a{1,}\E"
client.query(
q.RegexEscape('.Fa*[un]a{1,}')
)
.then((ret) => console.log(ret))
\Q.Fa*[un]a{1,}\E
print(client.query(
q.regex_escape(".Fa*[un]a{1,}")
))
\Q.Fa*[un]a{1,}\E
println(Await.result(
client.query(
RegexEscape(".Fa*[un]a{1,}"),
),
5.seconds
))
"\Q.Fa*[un]a{1,}\E"
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!