find
Checks whether a given regex pattern matches any part in the search string
.
find(searchString, regex)
#
ParameterssearchString
: Thestring
to search withinregex
: The regular expression pattern to match withsearchString
#
Returns- A boolean
true
only if there is at least one match otherwisefalse
.
#
ExamplesassertTrue(find(`That clever animalis a fox`, 'clever[\\s\\S]*fox'))
info
Read our notes on regular expression to learn about the regex pattern rules.