regex.is_match()

regex.is_match(haystack, pattern) returns true if the regex pattern matches anywhere in the haystack string, otherwise false.

Returns

  • if haystack is a string and pattern matches anywhere in it, returns true.

  • if haystack is a string and pattern does not match, returns false.

  • if haystack is not a string, returns null.

Examples

regex.is_match(message, /error|exception/i)

Last updated

Was this helpful?