Wednesday, March 12, 2014

Vs2013 search and replace in html classes

This lovely regex helps pull extra whitespace out of a class attribute. search: class="\s*(\w+)\s+(\s\w+)?\s*" replace: class="$1$2" It only handles up to 2 classes being inside and... I forgot to consider the possibility of having razor inside. However, this shouldn't break that it just won't clean it.