Regex to Indent an XML File

前端 未结 7 1862
攒了一身酷
攒了一身酷 2020-12-21 06:14

Is it possible to write a REGEX (search replace) that when run on an XML string will output that XML string indented nicely?

If so whats the REGEX :)

相关标签:
7条回答
  • 2020-12-21 06:58

    The dark voodoo regexp as described here works great.
    http://www.perlmonks.org/?node_id=261292
    Its main advantage against using XML::LibXMl and others is that it's an order of magnitude faster.

    0 讨论(0)
提交回复
热议问题