multi_match_any

Description

Syntax

TINYINT multi_match_any(VARCHAR haystack, ARRAY<VARCHAR> patterns)

Checks whether the string haystack matches the regular expressions patterns in re2 syntax. returns 0 if none of the regular expressions are matched and 1 if any of the patterns matches.

example

  1. mysql> select multi_match_any('Hello, World!', ['hello', '!', 'world']);
  2. +-----------------------------------------------------------+
  3. | multi_match_any('Hello, World!', ['hello', '!', 'world']) |
  4. +-----------------------------------------------------------+
  5. | 1 |
  6. +-----------------------------------------------------------+
  7. mysql> select multi_match_any('abc', ['A', 'bcd']);
  8. +--------------------------------------+
  9. | multi_match_any('abc', ['A', 'bcd']) |
  10. +--------------------------------------+
  11. | 0 |
  12. +--------------------------------------+

keywords

  1. MULTI_MATCH,MATCH,ANY