Paperless
  • Home
  • About
  • Categories
  • Newsletter

Add namespace prefix to XML tags in Vim

Victor Engmark, 2009-09-11

regex   Vim

It's not perfect, but it works with tags that contain just a-z and dashes (the \([a-z-]*\) part):

:%s/<\(\/\?\)\([a-z-]*\)\(\s\|>\)/<\1namespace:\2\3/gc

Comments? Feedback? Corrections? Send an email.

Version history

No webmentions were found.

  • © Victor Engmark Creative Commons License
  • engmark
  • l0b0

Web feed

⬅ Epesooj webring ➡