package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(<p(.*?)>)([[:space:]]+?|.*?|[[:space:]]+?)(<\/p>)`)
var str = `<p>Some text 1</p>
<p>Some text 2</p>
<p>Some text 3</p>`
var substitution = "$0 <img src="imagem.jpg">"
fmt.Println(re.ReplaceAllString(str, substitution))
}
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/