Skip to main content

find

Checks whether a given regex pattern matches any part in the search string.

find(searchString, regex)

Parameters#

  • searchString: The string to search within
  • regex: The regular expression pattern to match with searchString

Returns#

  • A boolean true only if there is at least one match otherwise false.

Examples#

assertTrue(find(`That clever animalis a fox`, 'clever[\\s\\S]*fox'))
info

Read our notes on regular expression to learn about the regex pattern rules.