Regex to Indent an XML File

前端 未结 7 1894
攒了一身酷
攒了一身酷 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:48

    Doing this would be far, far simpler if you didn't use a regex. In fact I'm not even sure it's possible with regex.

    Most languages have XML libraries that would make this task very simple. What language are you using?

提交回复
热议问题