Regex - Format with tabs and alphabetical
- by Sam
Is it possible to use regex to turn this
<site-ui:header title="error" backURL="javascript:history.go(-1);" />
into this
<site-ui:header
backURL="javascript:history.go(-1);"
title="error"
/>
Basically, my goal is to format this xml so that the fields are in alphabetical order (e.g. backURL comes before title), and each field should be tabbed two spaces.
If this can be done, any pointers would be really helpful! Even more helpful is an exact regex for vim.