You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ya...@apache.org on 2021/09/09 06:11:51 UTC
[incubator-doris] branch master updated: [Doc] modify irregular
documents (like/ not like/ regexp.md) (#6572)
This is an automated email from the ASF dual-hosted git repository.
yangzhg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new b3f0295 [Doc] modify irregular documents (like/ not like/ regexp.md) (#6572)
b3f0295 is described below
commit b3f02955d3b06352c59ec53eb95367afced108d1
Author: zhoubintao <35...@users.noreply.github.com>
AuthorDate: Thu Sep 9 14:11:37 2021 +0800
[Doc] modify irregular documents (like/ not like/ regexp.md) (#6572)
---
.../sql-functions/string-functions/like/like.md | 28 ++++++++++++++-----
.../string-functions/like/not_like.md | 31 +++++++++++++++++-----
.../string-functions/regexp/not_regexp.md | 2 +-
.../string-functions/regexp/regexp.md | 2 +-
.../string-functions/regexp/regexp_replace.md | 2 +-
.../sql-functions/string-functions/like/like.md | 28 ++++++++++++++-----
.../string-functions/like/not_like.md | 31 +++++++++++++++++-----
.../string-functions/regexp/not_regexp.md | 2 +-
.../string-functions/regexp/regexp.md | 2 +-
9 files changed, 97 insertions(+), 31 deletions(-)
diff --git a/docs/en/sql-reference/sql-functions/string-functions/like/like.md b/docs/en/sql-reference/sql-functions/string-functions/like/like.md
index 6fcbdf4..48affd6 100644
--- a/docs/en/sql-reference/sql-functions/string-functions/like/like.md
+++ b/docs/en/sql-reference/sql-functions/string-functions/like/like.md
@@ -28,23 +28,39 @@ under the License.
## description
### syntax
-'BOOLEAN like(VARCHAR str, VARCHAR pattern)'
+`BOOLEAN like(VARCHAR str, VARCHAR pattern)`
Perform fuzzy matching on the string str, return true if it matches, and false if it doesn't match.
like match/fuzzy match, will be used in combination with % and _.
-'a' // Precise matching, the same effect as `=`.
+the percent sign ('%') represents zero, one, or more characters.
+
+the underscore ('_') represents a single character.
+
+```
+'a' // Precise matching, the same effect as `=`
'%a' // data ending with a
'a%' // data starting with a
'%a%' // data containing a
-'_a_' // Three digits and the middle letter is a
-'_a' // Two digits and the ending letter is a
-'a_' // Two digits and the initial letter is a
-
+'_a_' // three digits and the middle letter is a
+'_a' // two digits and the ending letter is a
+'a_' // two digits and the initial letter is a
+'a__b' // four digits, starting letter is a and ending letter is b
+```
## example
```
+// table test
++-------+
+| k1 |
++-------+
+| b |
+| bb |
+| bab |
+| a |
++-------+
+
// Return the data containing a in the k1 string
mysql> select k1 from test where k1 like '%a%';
+-------+
diff --git a/docs/en/sql-reference/sql-functions/string-functions/like/not_like.md b/docs/en/sql-reference/sql-functions/string-functions/like/not_like.md
index 3bfeaf0..3ac280f 100644
--- a/docs/en/sql-reference/sql-functions/string-functions/like/not_like.md
+++ b/docs/en/sql-reference/sql-functions/string-functions/like/not_like.md
@@ -28,23 +28,39 @@ under the License.
## description
### syntax
-'BOOLEAN not like(VARCHAR str, VARCHAR pattern)'
+`BOOLEAN not like(VARCHAR str, VARCHAR pattern)`
Perform fuzzy matching on the string str, return false if it matches, and return true if it doesn't match.
like match/fuzzy match, will be used in combination with % and _.
-'a' // Precise matching, the same effect as `=`.
+the percent sign ('%') represents zero, one, or more characters.
+
+the underscore ('_') represents a single character.
+
+```
+'a' // Precise matching, the same effect as `=`
'%a' // data ending with a
'a%' // data starting with a
'%a%' // data containing a
-'_a_' // Three digits and the middle letter is a
-'_a' // Two digits and the ending letter is a
-'a_' // Two digits and the initial letter is a
-
+'_a_' // three digits and the middle letter is a
+'_a' // two digits and the ending letter is a
+'a_' // two digits and the initial letter is a
+'a__b' // four digits, starting letter is a and ending letter is b
+```
## example
```
+// table test
++-------+
+| k1 |
++-------+
+| b |
+| bb |
+| bab |
+| a |
++-------+
+
// Return data that does not contain a in the k1 string
mysql> select k1 from test where k1 not like '%a%';
+-------+
@@ -59,8 +75,9 @@ mysql> select k1 from test where k1 not like 'a';
+-------+
| k1 |
+-------+
-| bab |
| b |
+| bb |
+| bab |
+-------+
```
diff --git a/docs/en/sql-reference/sql-functions/string-functions/regexp/not_regexp.md b/docs/en/sql-reference/sql-functions/string-functions/regexp/not_regexp.md
index 7c5b94d..4001387 100644
--- a/docs/en/sql-reference/sql-functions/string-functions/regexp/not_regexp.md
+++ b/docs/en/sql-reference/sql-functions/string-functions/regexp/not_regexp.md
@@ -28,7 +28,7 @@ under the license.
## description
### syntax
-'BOOLEAN not regexp(VARCHAR str, VARCHAR pattern)'
+`BOOLEAN not regexp(VARCHAR str, VARCHAR pattern)`
Perform regular matching on the string str, return false if it matches, and return true if it doesn't match. pattern is a regular expression.
diff --git a/docs/en/sql-reference/sql-functions/string-functions/regexp/regexp.md b/docs/en/sql-reference/sql-functions/string-functions/regexp/regexp.md
index 221cf7e..f45f9e4 100644
--- a/docs/en/sql-reference/sql-functions/string-functions/regexp/regexp.md
+++ b/docs/en/sql-reference/sql-functions/string-functions/regexp/regexp.md
@@ -28,7 +28,7 @@ under the License.
## description
### syntax
-'BOOLEAN regexp(VARCHAR str, VARCHAR pattern)'
+`BOOLEAN regexp(VARCHAR str, VARCHAR pattern)`
Perform regular matching on the string str, return true if it matches, and return false if it doesn't match. pattern is a regular expression.
diff --git a/docs/en/sql-reference/sql-functions/string-functions/regexp/regexp_replace.md b/docs/en/sql-reference/sql-functions/string-functions/regexp/regexp_replace.md
index 1eeff8f..c7524dd 100644
--- a/docs/en/sql-reference/sql-functions/string-functions/regexp/regexp_replace.md
+++ b/docs/en/sql-reference/sql-functions/string-functions/regexp/regexp_replace.md
@@ -28,7 +28,7 @@ under the License.
## description
### Syntax
-`VARCHAR regexp_replace(VARCHAR str, VARCHAR pattern, VARCHAR repl)
+`VARCHAR regexp_replace(VARCHAR str, VARCHAR pattern, VARCHAR repl)`
Regular matching of STR strings, replacing the part hitting pattern with repl
diff --git a/docs/zh-CN/sql-reference/sql-functions/string-functions/like/like.md b/docs/zh-CN/sql-reference/sql-functions/string-functions/like/like.md
index 34a58d1..710cdf4 100644
--- a/docs/zh-CN/sql-reference/sql-functions/string-functions/like/like.md
+++ b/docs/zh-CN/sql-reference/sql-functions/string-functions/like/like.md
@@ -28,23 +28,39 @@ under the License.
## description
### syntax
-'BOOLEAN like(VARCHAR str, VARCHAR pattern)'
+`BOOLEAN like(VARCHAR str, VARCHAR pattern)`
对字符串 str 进行模糊匹配,匹配上的则返回 true,没匹配上则返回 false。
like 匹配/模糊匹配,会与 % 和 _ 结合使用。
-'a' // 精准匹配,和 `=` 效果一致。
+百分号 '%' 代表零个、一个或多个字符。
+
+下划线 '_' 代表单个字符。
+
+```
+'a' // 精准匹配,和 `=` 效果一致
'%a' // 以a结尾的数据
'a%' // 以a开头的数据
'%a%' // 含有a的数据
-'_a_' // 三位且中间字母是 a 的
-'_a' // 两位且结尾字母是 a 的
-'a_' // 两位且开头字母是 a 的
-
+'_a_' // 三位且中间字符是 a的数据
+'_a' // 两位且结尾字符是 a的数据
+'a_' // 两位且开头字符是 a的数据
+'a__b' // 四位且以字符a开头、b结尾的数据
+```
## example
```
+// table test
++-------+
+| k1 |
++-------+
+| b |
+| bb |
+| bab |
+| a |
++-------+
+
// 返回 k1 字符串中包含 a 的数据
mysql > select k1 from test where k1 like '%a%';
+-------+
diff --git a/docs/zh-CN/sql-reference/sql-functions/string-functions/like/not_like.md b/docs/zh-CN/sql-reference/sql-functions/string-functions/like/not_like.md
index 9960f32..776acab 100644
--- a/docs/zh-CN/sql-reference/sql-functions/string-functions/like/not_like.md
+++ b/docs/zh-CN/sql-reference/sql-functions/string-functions/like/not_like.md
@@ -28,23 +28,39 @@ under the License.
## description
### syntax
-'BOOLEAN not like(VARCHAR str, VARCHAR pattern)'
+`BOOLEAN not like(VARCHAR str, VARCHAR pattern)`
对字符串 str 进行模糊匹配,匹配上的则返回 false,没匹配上则返回 true。
like 匹配/模糊匹配,会与 % 和 _ 结合使用。
-'a' // 精准匹配,和 `=` 效果一致。
+百分号 '%' 代表零个、一个或多个字符。
+
+下划线 '_' 代表单个字符。
+
+```
+'a' // 精准匹配,和 `=` 效果一致
'%a' // 以a结尾的数据
'a%' // 以a开头的数据
'%a%' // 含有a的数据
-'_a_' // 三位且中间字母是 a 的
-'_a' // 两位且结尾字母是 a 的
-'a_' // 两位且开头字母是 a 的
-
+'_a_' // 三位且中间字母是 a 的数据
+'_a' // 两位且结尾字母是 a 的数据
+'a_' // 两位且开头字母是 a 的数据
+'a__b' // 四位且以字符a开头、b结尾的数据
+```
## example
```
+// table test
++-------+
+| k1 |
++-------+
+| b |
+| bb |
+| bab |
+| a |
++-------+
+
// 返回 k1 字符串中不包含 a 的数据
mysql > select k1 from test where k1 not like '%a%';
+-------+
@@ -59,8 +75,9 @@ mysql > select k1 from test where k1 not like 'a';
+-------+
| k1 |
+-------+
-| bab |
| b |
+| bb |
+| bab |
+-------+
```
diff --git a/docs/zh-CN/sql-reference/sql-functions/string-functions/regexp/not_regexp.md b/docs/zh-CN/sql-reference/sql-functions/string-functions/regexp/not_regexp.md
index 4d28e82..270a7e5 100644
--- a/docs/zh-CN/sql-reference/sql-functions/string-functions/regexp/not_regexp.md
+++ b/docs/zh-CN/sql-reference/sql-functions/string-functions/regexp/not_regexp.md
@@ -28,7 +28,7 @@ under the License.
## description
### syntax
-'BOOLEAN not regexp(VARCHAR str, VARCHAR pattern)'
+`BOOLEAN not regexp(VARCHAR str, VARCHAR pattern)`
对字符串 str 进行正则匹配,匹配上的则返回 false,没匹配上则返回 true。pattern 为正则表达式。
diff --git a/docs/zh-CN/sql-reference/sql-functions/string-functions/regexp/regexp.md b/docs/zh-CN/sql-reference/sql-functions/string-functions/regexp/regexp.md
index 3f59b36..fec1296 100644
--- a/docs/zh-CN/sql-reference/sql-functions/string-functions/regexp/regexp.md
+++ b/docs/zh-CN/sql-reference/sql-functions/string-functions/regexp/regexp.md
@@ -28,7 +28,7 @@ under the License.
## description
### syntax
-'BOOLEAN regexp(VARCHAR str, VARCHAR pattern)'
+`BOOLEAN regexp(VARCHAR str, VARCHAR pattern)`
对字符串 str 进行正则匹配,匹配上的则返回 true,没匹配上则返回 false。pattern 为正则表达式。
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org