package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`<p[<>ib]*>([\w\s]+)<\/[\w]>`)
var str = `<html><head></head><body><p>Aa aa </p><p><b>Aa aa aa </b></p><p>Aa aa aa aa </p><p><i>Aa aa </i></p><p><b><i>B b b </i></b></p><b>Aa aa aa </b></body></html>`
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/