package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`<text[^>]+>?.+?([а-яА-Я]+)`)
var str = `<g id="L-14-st-230" display="inline" opacity="1">
<text transform="matrix(1 0 0 1 226.6597 827.2749)" enable-background="new "><tspan x="0" y="0" fill="#191919" font-family="'PTSans-Regular'" font-size="16">Деловой центр</tspan><tspan x="31.6" y="14" fill="#191919" font-family="'PTSans-Regular'" font-size="16">(МЦК)</tspan></text>
</g>
<g id="L-14-st-228" display="inline" opacity="1">
<text transform="matrix(1 0 0 1 444.9458 1066.8765)" fill="#191919" font-family="'PTSans-Regular'" font-size="16">Лужники</text>
</g>`
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/