Removing anything between XML tags and their content

后端 未结 5 1900
无人及你
无人及你 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 04:52

    Please don't use regular expressions to parse XML. It's horribly error prone.

    Use a proper XML library, which will make this trivial. There are XML libraries available for just about every programming platform you could ask for - there's really no excuse to use a regular expression for XML.

提交回复
热议问题