package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`^.*<email.*>(.*)<\/email>\n.*<sureName>(.*)<\/sureName>\n.*<geschlecht.*>`)
var str = ` <email xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">tarek68@gmx.at</email>
<sureName>IRADA Mohamed Tlig</sureName>
<geschlecht xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:int">-1</geschlecht>`
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/