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

 

上一篇:js正则校验邮箱


下一篇:正则表达式基础 待完善