package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?i)<(\/?\b(?:span|a|input|div|i|b|s|u|br|li|ul|ol|small|img|body|html|head|h[1-6]|title|em)\b[^>]*)>`)
var str = `<span class="avatar2-default bg-dark rounded-circle">
<a href="">Hello</a>
<i>Hello</a>
<s>Hello</a>
<h1>Hello</h1>
<input type=
"text">
</span>
<>
<<
>>
</>`
var substitution = "<$1&t;"
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/