其他分享
首页 > 其他分享> > go语言第十课时

go语言第十课时

作者:互联网

 

 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);
    }
}

 

标签:语言,fmt,zA,第十课,go,textinfo,main,com,reg
来源: https://www.cnblogs.com/zh718594493/p/14289743.html