Result
jQuery
//class="color-***"にマッチするclass名を全部削除 $("#hello").removeClass (function (index, css) { return (css.match (/\bcolor-\S+/g) || []).join(' '); });
css
.color-red{color:red;}
html
<div id="hello" class="color-red color-brown foo bar">Hello</div>