add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
html REGEXP_REPLACE(html, '(<p .*class.*"| )myclass(.*[^p]>)', '$1prefix-myclass$2')

<div>
  <p class="myclass someotherclass1 someotherclass2">Some text.</p>
  <p class="someotherclass1 myclass someotherclass2">Some more text that contains the class name not as class, but as text: myclass</p>
</div>

<div>
  <p class="prefix-myclass someotherclass1 someotherclass2">Some text.</p>
  <p class="someotherclass1 prefix-myclass someotherclass2">Some more text that contains the class name not as class, but as text: myclass</p>
</div>