Stripping HTML with Regex

I wanted to strip every set of angle brackets in a file, and googling just reminded me that you can’t parse HTML with regex.

The vim command for this would be

:%s/\(<[^>]*>\)\+/\r/g

which replaces any amount of angle brackets with a carriage return.

comments powered by Disqus