mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-08 14:42:27 +08:00
Fix/339 (#344)
* feat: add ContainAny * fix: fix issue #339 --------- Co-authored-by: Jiawen <im@linjiawen.com>
This commit is contained in:
@@ -549,7 +549,7 @@ func main() {
|
||||
func IsEmail(email string) bool
|
||||
```
|
||||
|
||||
<b>示例:<span style="float:right;display:inline-block">[运行](https://go.dev/play/p/Os9VaFlT33G)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block">[运行](https://go.dev/play/p/HVQ5LAe-vFz)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -559,13 +559,28 @@ import (
|
||||
|
||||
func main() {
|
||||
result1 := validator.IsEmail("abc@xyz.com")
|
||||
result2 := validator.IsEmail("a.b@@com")
|
||||
result2 := validator.IsEmail("user@domain.co")
|
||||
result3 := validator.IsEmail("test.user@example.org")
|
||||
result4 := validator.IsEmail("@abc@xyz.com")
|
||||
result5 := validator.IsEmail("a.b@@com")
|
||||
result6 := validator.IsEmail("a.b@com")
|
||||
result7 := validator.IsEmail("test@example")
|
||||
|
||||
fmt.Println(result1)
|
||||
fmt.Println(result2)
|
||||
fmt.Println(result3)
|
||||
fmt.Println(result4)
|
||||
fmt.Println(result5)
|
||||
fmt.Println(result6)
|
||||
fmt.Println(result7)
|
||||
|
||||
// Output:
|
||||
// true
|
||||
// true
|
||||
// true
|
||||
// false
|
||||
// false
|
||||
// false
|
||||
// false
|
||||
}
|
||||
```
|
||||
|
||||
@@ -551,7 +551,7 @@ func main() {
|
||||
func IsEmail(email string) bool
|
||||
```
|
||||
|
||||
<b>Example:<span style="float:right;display:inline-block">[Run](https://go.dev/play/p/Os9VaFlT33G)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block">[Run](https://go.dev/play/p/HVQ5LAe-vFz)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -561,13 +561,28 @@ import (
|
||||
|
||||
func main() {
|
||||
result1 := validator.IsEmail("abc@xyz.com")
|
||||
result2 := validator.IsEmail("a.b@@com")
|
||||
result2 := validator.IsEmail("user@domain.co")
|
||||
result3 := validator.IsEmail("test.user@example.org")
|
||||
result4 := validator.IsEmail("@abc@xyz.com")
|
||||
result5 := validator.IsEmail("a.b@@com")
|
||||
result6 := validator.IsEmail("a.b@com")
|
||||
result7 := validator.IsEmail("test@example")
|
||||
|
||||
fmt.Println(result1)
|
||||
fmt.Println(result2)
|
||||
fmt.Println(result3)
|
||||
fmt.Println(result4)
|
||||
fmt.Println(result5)
|
||||
fmt.Println(result6)
|
||||
fmt.Println(result7)
|
||||
|
||||
// Output:
|
||||
// true
|
||||
// true
|
||||
// true
|
||||
// false
|
||||
// false
|
||||
// false
|
||||
// false
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user