Check out v4 of the Fauna CLI

v4 of the Fauna CLI is now in beta.

The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start.

string.includesRegex()

Find if source string includes a string that matches a regex.

Signature

includesRegex(regex: String) => Boolean

Description

Evaluates if the source string includes a string that matches regex.

Parameters

Parameter Type Required Description

regex

String

Yes

Regular expression used to match a substring in the string. Supports Java regex.

Return value

Type Description

Boolean

String matching regex found flag:
true = Source string includes a string that matches regex.
false = Source string doesn’t include a string that matches regex.

Examples

'foo'.includesRegex('[a-z]')
true

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!