Removing anything between XML tags and their content

后端 未结 5 1907
无人及你
无人及你 2021-01-07 04:40

I would need to remove anything between XML tags, especially whitespace and newlines.

For example removing whitespace and newslines from:
\\n<

5条回答
  •  青春惊慌失措
    2021-01-07 05:02

    You shouldn't use regex to parse XML or HTML, it's just not reliable and there are way too many edge cases. You should use a XML/HTML parser for this kind of stuff instead.

提交回复
热议问题