-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update docs for string functions multi-match-any, multi-search-all-positions, ngram-search and tokenize #1948
base: master
Are you sure you want to change the base?
Conversation
multi-search-all-positions, ngram-search and tokenize
multi-search-all-positions, ngram-search and tokenize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
只评论了第一个文件,麻烦都改一下
|
||
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. | ||
```sql | ||
TINYINT multi_match_any(VARCHAR haystack, ARRAY<VARCHAR> patterns) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 不用参数类型和返回类型
- 函数名大写
- 参数需要尖括号包裹
TINYINT multi_match_any(VARCHAR haystack, ARRAY<VARCHAR> patterns) | |
MULTI_MATCH_ANY(<haystack>, <patterns>) |
| `haystack` | The string to be checked | | ||
| `patterns` | Array of regular expressions | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `haystack` | The string to be checked | | |
| `patterns` | Array of regular expressions | | |
| `<haystack>` | The string to be checked | | |
| `<patterns>` | Array of regular expressions | |
|
||
## Return Value | ||
|
||
Returns 1 if the string `haystack` matches any of the regular expressions in the `patterns` array, otherwise returns 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returns 1 if the string `haystack` matches any of the regular expressions in the `patterns` array, otherwise returns 0. | |
Returns 1 if the string `<haystack>` matches any of the regular expressions in the `<patterns>` array, otherwise returns 0. |
## Examples | ||
|
||
```sql | ||
mysql> SELECT multi_match_any('Hello, World!', ['hello', '!', 'world']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要prompt
mysql> SELECT multi_match_any('Hello, World!', ['hello', '!', 'world']); | |
SELECT multi_match_any('Hello, World!', ['hello', '!', 'world']); |
+-----------------------------------------------------------+ | ||
| multi_match_any('Hello, World!', ['hello', '!', 'world']) | | ||
+-----------------------------------------------------------+ | ||
| 1 | | ||
+-----------------------------------------------------------+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
结果和查询分开放到两个 code block 中,结果使用 text 格式
```text
+-----------------------------------------------------------+
| multi_match_any('Hello, World!', ['hello', '!', 'world']) |
+-----------------------------------------------------------+
| 1 |
+-----------------------------------------------------------+
```
Versions
Languages
Docs Checklist