1.案例一
package main import ( "fmt" "regexp" ) func main(){ textinfo:="email is ahdcd@qq.com email is cc@qqq.com"; reg:=regexp.MustCompile(`[0-9a-zA-z]*@[a-zA-z]*.com`); info:=reg.FindAllString(textinfo,-1); for _,v:=range info { fmt.Println(v); } }
2024-03-20 20:37:58
1.案例一
package main import ( "fmt" "regexp" ) func main(){ textinfo:="email is ahdcd@qq.com email is cc@qqq.com"; reg:=regexp.MustCompile(`[0-9a-zA-z]*@[a-zA-z]*.com`); info:=reg.FindAllString(textinfo,-1); for _,v:=range info { fmt.Println(v); } }
下一篇:正则表达式基础 待完善