提交 39282413 编写于 作者: _Fighter's avatar _Fighter

8月8日

上级 e855f080
package main
import (
"fmt"
"regexp"
)
const text = `my email is wewfw@hdf.com
mail1 fwefwe@efw.com.cn
mail2 test@qq.com.cn`
func main() {
$END$
/*re2 ,_:= regexp.Compile(`[a-zA-Z0-9]+@[a-zA-Z0-9.]+\.[a-zA-Z0-9]+`)
findString := re2.FindAllString(text,-1)
fmt.Println(findString)*/
re := regexp.MustCompile(`([a-zA-Z0-9]+)@([a-zA-Z0-9]+)\.([a-zA-Z0-9.]+)`)
//allString := re.FindAllString(text, -1)
submatch := re.FindAllStringSubmatch(text, -1)
for _, m := range submatch {
fmt.Println(m)
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册