package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?mi)^([a-z0-9_-]+)(\.[a-z0-9_-]+)?@([a-z0-9_-]+)\.([a-z0-9]{2,})$`)
var str = `<header class="noSelect">
<div id="HIAccueil" class="I-B">
<img class="pointer" src="IMG/BACKGROUND/HEADER/logoban.png" alt="Accueil" onclick="clickMenu(tousLesMenus, 2, tousLesMenus[0].nom, 1, 0, 0, 0, tousLesMenus[1].url);">
</div>
<div id="HIPC">
<div id="HIProfile" class="I-B">
<!-- vide pour img via js -->
</div>
<div id="HIConnect" class="I-B">
<img class="pointer" src="IMG/BACKGROUND/HEADER/connect_hover.gif" alt="Connect" onclick="clickMenu(tousLesMenus, 5, tousLesMenus[0].nom, 4, 1, 1, 0, tousLesMenus[4].url);">
</div>
</div>
</header>
Tralloc_Nivek-02.baza_R-d421@gmail45.com
Tralloc_Nivek-02@gmail45.com
Tralloc_Nivek-02.baza_R-d421gmail45.c
010/226679
010226679
010/22.66.79
010/22 66 79
0470040747
0470/040747
0470/040.747
0470/04.07.47
0470/04 07 47
0470/040 747
+0032470040747
0032470/040 747
+00320470040747`
for i, match := range re.FindAllString(str, -1) {
fmt.Println(match, "found at index", i)
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Golang, please visit: https://golang.org/pkg/regexp/