package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`[A-Z][a-z]+:`)
var str = `<ul>
<li>Frankfurt/Main</li>
<li>Germany</li>
<li>Architect: Coop Himmelb(l)au</li>
<li>2008 - 2014</li>
<li>Client: European Central Bank ECB</li>
<li>Engineering Firm: ARGE IFFT-ML / Prof. Schott – Prof. Lange, Arup GmbH, AS&P – Albert Speer & Partner GmbH, B + G Ingenieure, Bollinger & Grohmann GmbH with Grontmij BGS Ingenieurgesellschaft mbH</li>
<li>Contractor: Züblin AG</li>
<li>Photographer: © European Central Bank/Robert Metsch</li>
</ul>
<p> </p>`
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/