As an example, I'm trying to replace
<script type='text/javascript'>some stuff</script>
with:
<div type='text/javascript'>some stuff</div>
I am currently testing:
alert( o.replace( /(?:<\s*\/?\s*)(script)(?:\s*([^>]*)?\s*>)/gi ,'div') );
But I get:
divsomestuffdiv
How can I get this to replace only the "script" part and save the other markup and attribute characters?
Geuis source share