Im trying to do a code coloring program where certain keywords are replaced with colorized text. Until now im able to succeed at replacing certain keywords but im not able to replace the words between the quotes. for example i would like to replace.
var message='"im some text"';
var message='<span style="color:yellow">im some text</span>';
If you want to replace text between quotes in a string then use
replace() with captured group regex and do something like this
var div = document.getElementById('div'); div.innerHTML = div.innerHTML.replace(/"([^"]+)"/g, '<span style="color:yellow">$1</span>');
<div id="div">abc "asasa" abc</div>