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

Regex to compare against source string.

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!