Skip to content

Instantly share code, notes, and snippets.

@branquito
Created March 9, 2013 00:34
Show Gist options
  • Save branquito/5121744 to your computer and use it in GitHub Desktop.
Save branquito/5121744 to your computer and use it in GitHub Desktop.
VIM regex
Strip class attributes from HTML tags, including those spanning over multiple lines
Change `class` word for anything else you want to strip..
:%s/<\s*\(\w*\)\s*class[^>]*>\([^<]\_.\{-}\)<\/.*>/<\1>\2<\/\1>/gc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment