JSFiddle - React, Tailwind, and code Playground

HTML

<div class="aaa table-col-30"></div>
<div class="table-col-30 aaa"></div>

CSS

.aaa {
    width: 50px;
    height: 50px;
    background: black;
}

.table-col-30 {
    background: red;
}

JavaScript

targ = 'table-col';
$('[class*="'+targ+'"]').removeClass(function(index, css) {
    var re = new RegExp(targ+"-\\d+");
    return (css.match(re) || []).join(' ');
});