1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-15 18:22:27 +08:00

doc: update doc for validator package

This commit is contained in:
dudaodong
2023-01-06 14:14:00 +08:00
parent 4044deac70
commit e21dd07d46
4 changed files with 171 additions and 68 deletions

116
README.md
View File

@@ -562,8 +562,6 @@ import "github.com/duke-git/lancet/v2/random"
[[doc](https://github.com/duke-git/lancet/blob/main/docs/random.md#UUIdV4)] [[doc](https://github.com/duke-git/lancet/blob/main/docs/random.md#UUIdV4)]
[[play](https://go.dev/play/p/_Z9SFmr28ft)] [[play](https://go.dev/play/p/_Z9SFmr28ft)]
### 15. Retry package is for executing a function repeatedly until it was successful or canceled by the context. ### 15. Retry package is for executing a function repeatedly until it was successful or canceled by the context.
```go ```go
@@ -746,8 +744,6 @@ import "github.com/duke-git/lancet/v2/slice"
[[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#KeyBy)] [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#KeyBy)]
[[play](https://go.dev/play/p/uXod2LWD1Kg)] [[play](https://go.dev/play/p/uXod2LWD1Kg)]
### 17. Strutil package contains some functions to manipulate string. ### 17. Strutil package contains some functions to manipulate string.
```go ```go
@@ -859,34 +855,90 @@ import "github.com/duke-git/lancet/v2/validator"
#### Function list: #### Function list:
- [ContainChinese](https://github.com/duke-git/lancet/blob/main/docs/validator.md#ContainChinese) - **<big>ContainChinese</big>** : check if the string contain mandarin chinese.
- [ContainLetter](https://github.com/duke-git/lancet/blob/main/docs/validator.md#ContainLetter) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#ContainChinese)]
- [ContainLower](https://github.com/duke-git/lancet/blob/main/docs/validator.md#ContainLower) [[play](https://go.dev/play/p/7DpU0uElYeM)]
- [ContainUpper](https://github.com/duke-git/lancet/blob/main/docs/validator.md#ContainUpper) - **<big>ContainLetter</big>** : check if the string contain at least one letter.
- [IsAlpha](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsAlpha) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#ContainLetter)]
- [IsAllUpper](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsAllUpper) [[play](https://go.dev/play/p/lqFD04Yyewp)]
- [IsAllLower](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsAllLower) - **<big>ContainLower</big>** : check if the string contain at least one lower case letter a-z.
- [IsBase64](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsBase64) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#ContainLower)]
- [IsChineseMobile](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsChineseMobile) [[play](https://go.dev/play/p/Srqi1ItvnAA)]
- [IsChineseIdNum](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsChineseIdNum) - **<big>ContainUpper</big>** : check if the string contain at least one upper case letter A-Z.
- [IsChinesePhone](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsChinesePhone) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#ContainUpper)]
- [IsCreditCard](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsCreditCard) [[play](https://go.dev/play/p/CmWeBEk27-z)]
- [IsDns](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsDns) - **<big>IsAlpha</big>** : checks if the string contains only letters (a-zA-Z).
- [IsEmail](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsEmail) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsAlpha)]
- [IsEmptyString](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsEmptyString) [[play](https://go.dev/play/p/7Q5sGOz2izQ)]
- [IsFloatStr](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsFloatStr) - **<big>IsAllUpper</big>** : check if the string is all upper case letters A-Z.
- [IsNumberStr](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsNumberStr) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsAllUpper)]
- [IsJSON](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsJSON) [[play](https://go.dev/play/p/ZHctgeK1n4Z)]
- [IsRegexMatch](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsRegexMatch) - **<big>IsAllLower</big>** : check if the string is all lower case letters a-z.
- [IsIntStr](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsIntStr) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsAllLower)]
- [IsIp](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsIp) [[play](https://go.dev/play/p/GjqCnOfV6cM)]
- [IsIpV4](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsIpV4) - **<big>IsBase64</big>** : check if the string is base64 string.
- [IsIpV6](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsIpV6) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsBase64)]
- [IsStrongPassword](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsStrongPassword) [[play](https://go.dev/play/p/sWHEySAt6hl)]
- [IsUrl](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsUrl) - **<big>IsChineseMobile</big>** : check if the string is chinese mobile number.
- [IsWeakPassword](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsWeakPassword) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsChineseMobile)]
- [IsZeroValue](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsZeroValue) [[play](https://go.dev/play/p/GPYUlGTOqe3)]
- [IsGBK](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsGBK) - **<big>IsChineseIdNum</big>** : check if the string is chinese id card.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsChineseIdNum)]
[[play](https://go.dev/play/p/d8EWhl2UGDF)]
- **<big>IsChinesePhone</big>** : check if the string is chinese phone number.(xxx-xxxxxxxx or xxxx-xxxxxxx.)
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsChinesePhone)]
[[play](https://go.dev/play/p/RUD_-7YZJ3I)]
- **<big>IsCreditCard</big>** : check if the string is credit card.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsCreditCard)]
[[play](https://go.dev/play/p/sNwwL6B0-v4)]
- **<big>IsDns</big>** : check if the string is dns.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsDns)]
[[play](https://go.dev/play/p/jlYApVLLGTZ)]
- **<big>IsEmail</big>** : check if the string is a email address.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsEmail)]
[[play](https://go.dev/play/p/Os9VaFlT33G)]
- **<big>IsEmptyString</big>** : check if the string is empty.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsEmptyString)]
[[play](https://go.dev/play/p/dpzgUjFnBCX)]
- **<big>IsFloatStr</big>** : check if the string can convert to a float.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#LOYwS_Oyl7U)]
[[play](https://go.dev/play/p/LOYwS_Oyl7U)]
- **<big>IsNumberStr</big>** : check if the string can convert to a number.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsNumberStr)]
[[play](https://go.dev/play/p/LzaKocSV79u)]
- **<big>IsJSON</big>** : check if the string is valid JSON.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsJSON)]
[[play](https://go.dev/play/p/sRS6c4K8jGk)]
- **<big>IsRegexMatch</big>** : check if the string match the regexp.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsRegexMatch)]
[[play](https://go.dev/play/p/z_XeZo_litG)]
- **<big>IsIntStr</big>** : check if the string can convert to a integer.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsIntStr)]
[[play](https://go.dev/play/p/jQRtFv-a0Rk)]
- **<big>IsIp</big>** : check if the string is ip.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsIp)]
[[play](https://go.dev/play/p/FgcplDvmxoD)]
- **<big>IsIpV4</big>** : check if the string is ipv4.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsIpV4)]
[[play](https://go.dev/play/p/zBGT99EjaIu)]
- **<big>IsIpV6</big>** : check if the string is ipv6.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsIpV6)]
[[play](https://go.dev/play/p/AHA0r0AzIdC)]
- **<big>IsStrongPassword</big>** : check if the string is strong password.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsStrongPassword)]
[[play](https://go.dev/play/p/QHdVcSQ3uDg)]
- **<big>IsUrl</big>** : check if the string is url.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsUrl)]
[[play](https://go.dev/play/p/pbJGa7F98Ka)]
- **<big>IsWeakPassword</big>** : check if the string is weak password.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsWeakPassword)]
[[play](https://go.dev/play/p/wqakscZH5gH)]
- **<big>IsZeroValue</big>** : check if value is a zero value.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsZeroValue)]
[[play](https://go.dev/play/p/UMrwaDCi_t4)]
- **<big>IsGBK</big>** : check if data encoding is gbk.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsGBK)]
[[play](https://go.dev/play/p/E2nt3unlmzP)]
### 20. xerror package implements helpers for errors. ### 20. xerror package implements helpers for errors.

View File

@@ -857,34 +857,91 @@ import "github.com/duke-git/lancet/v2/validator"
#### 函数列表: #### 函数列表:
- [ContainChinese](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#ContainChinese) - **<big>ContainChinese</big>** : 验证字符串是否包含中文字符。
- [ContainLetter](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#ContainLetter) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#ContainChinese)]
- [ContainLower](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#ContainLower) [[play](https://go.dev/play/p/7DpU0uElYeM)]
- [ContainUpper](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#ContainUpper) - **<big>ContainLetter</big>** : 验证字符串是否包含至少一个英文字母。
- [IsAlpha](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsAlpha) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#ContainLetter)]
- [IsAllUpper](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsAllUpper) [[play](https://go.dev/play/p/lqFD04Yyewp)]
- [IsAllLower](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsAllLower) - **<big>ContainLower</big>** : 验证字符串是否包含至少一个英文小写字母。
- [IsBase64](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsBase64) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#ContainLower)]
- [IsChineseMobile](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsChineseMobile) [[play](https://go.dev/play/p/Srqi1ItvnAA)]
- [IsChineseIdNum](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsChineseIdNum) - **<big>ContainUpper</big>** : 验证字符串是否包含至少一个英文大写字母。
- [IsChinesePhone](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsChinesePhone) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#ContainUpper)]
- [IsCreditCard](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsCreditCard) [[play](https://go.dev/play/p/CmWeBEk27-z)]
- [IsDns](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsDns) - **<big>IsAlpha</big>** : 验证字符串是否只包含英文字母。
- [IsEmail](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsEmail) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsAlpha)]
- [IsEmptyString](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsEmptyString) [[play](https://go.dev/play/p/7Q5sGOz2izQ)]
- [IsFloatStr](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsFloatStr) - **<big>IsAllUpper</big>** : 验证字符串是否全是大写英文字母。
- [IsNumberStr](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsNumberStr) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsAllUpper)]
- [IsJSON](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsJSON) [[play](https://go.dev/play/p/ZHctgeK1n4Z)]
- [IsRegexMatch](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsRegexMatch) - **<big>IsAllLower</big>** : 验证字符串是否全是小写英文字母。
- [IsIntStr](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsIntStr) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsAllLower)]
- [IsIp](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsIp) [[play](https://go.dev/play/p/GjqCnOfV6cM)]
- [IsIpV4](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsIpV4) - **<big>IsBase64</big>** : 验证字符串是否是base64编码。
- [IsIpV6](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsIpV6) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsBase64)]
- [IsStrongPassword](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsStrongPassword) [[play](https://go.dev/play/p/sWHEySAt6hl)]
- [IsUrl](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsUrl) - **<big>IsChineseMobile</big>** : 验证字符串是否是中国手机号码。
- [IsWeakPassword](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsWeakPassword) [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsChineseMobile)]
- [IsZeroValue](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsZeroValue) [[play](https://go.dev/play/p/GPYUlGTOqe3)]
- [IsGBK](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsGBK) - **<big>IsChineseIdNum</big>** : 验证字符串是否是中国身份证号码。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsChineseIdNum)]
[[play](https://go.dev/play/p/d8EWhl2UGDF)]
- **<big>IsChinesePhone</big>** : 验证字符串是否是中国电话座机号码(xxx-xxxxxxxx or xxxx-xxxxxxx.)。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsChinesePhone)]
[[play](https://go.dev/play/p/RUD_-7YZJ3I)]
- **<big>IsCreditCard</big>** : 验证字符串是否是信用卡号码。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsCreditCard)]
[[play](https://go.dev/play/p/sNwwL6B0-v4)]
- **<big>IsDns</big>** : 验证字符串是否是有效dns。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsDns)]
[[play](https://go.dev/play/p/jlYApVLLGTZ)]
- **<big>IsEmail</big>** : 验证字符串是否是有效电子邮件地址。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsEmail)]
[[play](https://go.dev/play/p/Os9VaFlT33G)]
- **<big>IsEmptyString</big>** : 验证字符串是否是空字符串。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsEmptyString)]
[[play](https://go.dev/play/p/dpzgUjFnBCX)]
- **<big>IsFloatStr</big>** : 验证字符串是否是可以转换为浮点数。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#LOYwS_Oyl7U)]
[[play](https://go.dev/play/p/LOYwS_Oyl7U)]
- **<big>IsNumberStr</big>** : 验证字符串是否是可以转换为数字。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsNumberStr)]
[[play](https://go.dev/play/p/LzaKocSV79u)]
- **<big>IsJSON</big>** : 验证字符串是否是有效json。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsJSON)]
[[play](https://go.dev/play/p/sRS6c4K8jGk)]
- **<big>IsRegexMatch</big>** : 验证字符串是否可以匹配正则表达式。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsRegexMatch)]
[[play](https://go.dev/play/p/z_XeZo_litG)]
- **<big>IsIntStr</big>** : 验证字符串是否是可以转换为整数。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsIntStr)]
[[play](https://go.dev/play/p/jQRtFv-a0Rk)]
- **<big>IsIp</big>** : 验证字符串是否是ip地址。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsIp)]
[[play](https://go.dev/play/p/FgcplDvmxoD)]
- **<big>IsIpV4</big>** : 验证字符串是否是ipv4地址。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsIpV4)]
[[play](https://go.dev/play/p/zBGT99EjaIu)]
- **<big>IsIpV6</big>** : 验证字符串是否是ipv6地址。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsIpV6)]
[[play](https://go.dev/play/p/AHA0r0AzIdC)]
- **<big>IsStrongPassword</big>** : 验证字符串是否是强密码:(字母+数字+特殊字符)。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsStrongPassword)]
[[play](https://go.dev/play/p/QHdVcSQ3uDg)]
- **<big>IsUrl</big>** : 验证字符串是否是url。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsUrl)]
[[play](https://go.dev/play/p/pbJGa7F98Ka)]
- **<big>IsWeakPassword</big>** : 验证字符串是否是弱密码(只包含字母+数字)。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsWeakPassword)]
[[play](https://go.dev/play/p/wqakscZH5gH)]
- **<big>IsZeroValue</big>** : 判断传入的参数值是否为零值。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsZeroValue)]
[[play](https://go.dev/play/p/UMrwaDCi_t4)]
- **<big>IsGBK</big>** : 检查数据编码是否为gbk汉字内部代码扩展规范
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsGBK)]
[[play](https://go.dev/play/p/E2nt3unlmzP)]
### 20. xerror 包实现一些错误处理函数 ### 20. xerror 包实现一些错误处理函数

View File

@@ -459,8 +459,6 @@ func main() {
### <span id="IsEmptyString">IsEmptyString</span> ### <span id="IsEmptyString">IsEmptyString</span>
<p>验证字符串是否是空字符串</p> <p>验证字符串是否是空字符串</p>
@@ -488,7 +486,6 @@ func main() {
### <span id="IsFloatStr">IsFloatStr</span> ### <span id="IsFloatStr">IsFloatStr</span>
<p>验证字符串是否是可以转换为浮点数</p> <p>验证字符串是否是可以转换为浮点数</p>
@@ -574,8 +571,6 @@ func main() {
``` ```
### <span id="IsRegexMatch">IsRegexMatch</span> ### <span id="IsRegexMatch">IsRegexMatch</span>
<p>验证字符串是否可以匹配正则表达式</p> <p>验证字符串是否可以匹配正则表达式</p>
@@ -601,7 +596,6 @@ func main() {
### <span id="IsIntStr">IsIntStr</span> ### <span id="IsIntStr">IsIntStr</span>
<p>验证字符串是否是可以转换为整数</p> <p>验证字符串是否是可以转换为整数</p>

View File

@@ -69,7 +69,7 @@ func ContainUpper(str string) bool {
return false return false
} }
// ContainLower check if the string contain at least one lower case letter A-Z. // ContainLower check if the string contain at least one lower case letter a-z.
// Play: https://go.dev/play/p/Srqi1ItvnAA // Play: https://go.dev/play/p/Srqi1ItvnAA
func ContainLower(str string) bool { func ContainLower(str string) bool {
for _, r := range str { for _, r := range str {
@@ -192,7 +192,7 @@ func IsChineseIdNum(id string) bool {
return chineseIdMatcher.MatchString(id) return chineseIdMatcher.MatchString(id)
} }
// ContainChinese check if the string contain mandarin chinese.. // ContainChinese check if the string contain mandarin chinese.
// Play: https://go.dev/play/p/7DpU0uElYeM // Play: https://go.dev/play/p/7DpU0uElYeM
func ContainChinese(s string) bool { func ContainChinese(s string) bool {
return chineseMatcher.MatchString(s) return chineseMatcher.MatchString(s)