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() {

	/*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)
	}

}
