ContainsStrRegex
ContainsStrRegex( value, pattern )
ContainsStrRegex( value, pattern )
ContainsStrRegex( value, pattern )
ContainsStrRegex( value, pattern )
contains_str_regex( value, pattern )
Not available in this language yet.
ContainsStrRegex( value, pattern )
Not available in this language yet.
Description
The ContainsStrRegex
function returns true
when the value
string
matches the pattern
regular expression, or false
when it does not.
Returns
Returns a boolean: true
when value
matches the pattern
regular
expression, or false
when it does not.
Examples
The following query demonstrates the case where the value
string
matches the pattern
regular expression:
Value result = await client.Query(
ContainsStrRegex("Fauna", "(Fa|na)")
);
IResult<Value> data = result.To<Value>();
data.Match(
Success: value => Console.WriteLine($"{value}"),
Failure: error => Console.WriteLine($"Query failed:\n{error}")
);
result, err := client.Query(
f.ContainsStrRegex("Fauna", "(Fa|na)"))
if (err != nil) {
fmt.Println(err)
} else {
fmt.Println(result)
}
System.out.println(
client.query(
ContainsStrRegex("Fauna", "(Fa|na)")
).get()
);
client.query(
q.ContainsStrRegex('Fauna', '(Fa|na)')
)
.then((ret) => console.log(ret))
print(client.query(
q.contains_str_regex("Fauna", "(Fa|na)")
))
Not available in this language yet.
println(Await.result(
client.query(
ContainsStrRegex("Fauna", "(Fa|na)"),
),
5.seconds
))
Not available in this language yet.
BooleanV(True)
true
true
true
True
true
The following query demonstrates the case where the value
string
does not match the pattern
regular expression:
Value result = await client.Query(
ContainsStrRegex("Fauna", ".Faa*")
);
IResult<Value> data = result.To<Value>();
data.Match(
Success: value => Console.WriteLine($"{value}"),
Failure: error => Console.WriteLine($"Query failed:\n{error}")
);
result, err := client.Query(
f.ContainsStrRegex("Fauna", ".Faa*"))
if (err != nil) {
fmt.Println(err)
} else {
fmt.Println(result)
}
System.out.println(
client.query(
ContainsStrRegex("Fauna", ".Faa*")
).get()
);
client.query(
q.ContainsStrRegex('Fauna', '.Faa*')
)
.then((ret) => console.log(ret))
print(client.query(
q.contains_str_regex("Fauna", ".Faa*")
))
Not available in this language yet.
println(Await.result(
client.query(
ContainsStrRegex("Fauna", ".Faa*"),
),
5.seconds
))
Not available in this language yet.
BooleanV(False)
false
false
false
False
false
Was this article helpful?
We're sorry to hear that.
Tell us how we can improve!
documentation@fauna.com
Thank you for your feedback!