I'm trying to replace all html tag such as <div> </div>
... on empty string ( " " ) in golang with regex pattern ^[^.\/]*$/g
to match all close tag. ex : </div>
My solution:
package main
import (
"fmt"
"regexp"
)
const Template = `^[^.\/]*$/g`
func main() {
r := regexp.MustCompile(Template)
s := "afsdf4534534!@@!!#<div>345345afsdf4534534!@@!!#</div>"
res := r.ReplaceAllString(s, "")
fmt.Println(res)
}
But output the same source string. What's wrong? Please help. Thank
Expect Result should: "afsdf4534534!@@!!#345345afsdf4534534!@@!!#"