Answer the question
In order to leave comments, you need to log in
Why does it search for only 1 email and end?
str := `email: [email protected] email: [email protected]`
r := regexp.MustCompile("\\b[A-Za-z0-9._%+-][email protected][A-Za-z0-9.-]+\\.[A-Za-z]{2,6}\\b")
for index, match := range r.FindStringSubmatch(str) {
fmt.Printf("[%d] %s\n", index, match)
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question