package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?mi)^([A-ZÄäÖöÜüß.\s-]+?)\s*(\d+(?:[/-]\d+)?(?:[A-Z](?:-[A-Z])?)?)\b`)
var str = `Berliner Str. 74
Hindenburgdamm 27, Hygiene-Institut
Peschkestr. 5a/Holsteinische Str. 44
Lankwitzer Str. 13-17a
Fidicinstr. 15A
Johanna-Stegen-Strasse 14a-d
Friedrichshaller Str. 7
Haudegen Weg 15/17
Südwestkorso 9`
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/