PHP » GoLang |
login |
register |
about
|
htmlspecialcharshtmlspecialcharsfunc HtmlSpecialchars(html string) string, { reg,err := regexp.Compile(`<([\w]+)(\s*[\w]+=([\w]+|"[^"]+"))*>(.*)<[/]?([\w]+)>`) if err != nil { return html } ret := html for reg.MatchString(ret) { ret = reg.ReplaceAllString(ret, "$4") } return ret } |