go process html data

    //Remove all HTML codes in angle brackets and replace them with line breaks
 re, _ = regexp.Compile("\\<[\\S\\s]+?\\>")
   str = re.ReplaceAllString(str, "\n")
   fmt.Println(str)

//Remove continuous line breaks and replace with empty

re, _ := regexp.Compile("\\s{1,}")
str = re.ReplaceAllString(str, " ")

 

Guess you like

Origin blog.csdn.net/lctmei/article/details/115616991