JSFiddle - React, Tailwind, and code Playground

HTML

<div class="ativo37 and many other classes">s</div>
<div class="another classes here with ativo1">s</div>
<div class="here ativo9 and more two or three">d</div>

CSS

.ativo37,.ativo1,.ativo9{
    background:grey;
}

JavaScript

$("div[class*='ativo']").removeClass (function (index, css) {
  return (css.match (/(^|\s)ativo\S+/g) || []).join(' ');
});