multi_match_any

Description

Syntax

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

检查字符串 haystack 是否与 re2 语法中的正则表达式 patterns 相匹配。如果都没有匹配的正则表达式返回 0,否则返回 1。

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