Regexp to search/replace only text, not in HTML attribute

后端 未结 6 1308
自闭症患者
自闭症患者 2020-12-11 18:44

I\'m using JavaScript to do some regular expression. Considering I\'m working with well-formed source, and I want to remove any space before[,.] and keep only one space afte

6条回答
  •  死守一世寂寞
    2020-12-11 19:30

    Don't parse regexHTML with HTMLregex. If you know your HTML is well-formed, use an HTML/XML parser. Otherwise, run it through Tidy first and then use an XML parser.

提交回复
热议问题