切换导航
{{systemName}}
{{ info.Title }}
{{info.Title}}
{{ menu.Title }}
{{menu.Title}}
登录
|
退出
搜索
golang正则匹配邮箱等持续更新
作者:ych
#### 匹配邮箱 ``` package main import ( "fmt" "regexp" ) func CheckEmailFormat(regexp *regexp.Regexp, e string) bool { if !regexp.MatchString(e) { return false } return true } func main() { emailRegexp := regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$") b := CheckEmailFormat(emailRegexp, "legend9999@126.com") fmt.Println(b) } ```
评论区
先去登录
版权所有:机遇屋在线 Copyright © 2021-2025 jiyuwu Co., Ltd.
鲁ICP备16042261号-1