I have a string
$$_### ABC ###_$$ $$_### PQR ###_$$ $$_### XYZ ###_$$
I wanted to replace $$_###
with and li
tag and ###_$$
with a closing li
tag.
So the final output should be <li>ABC</li><li>PQR</li><li>XYZ</li>
What I have used is this
str = $$_### ABC ###_$$ $$_### PQR ###_$$ $$_### XYZ ###_$$;
new_str = (str.replace(/$$_###/g,'<li>')).replace(/###_$$/g,'</li>');
It doesn't seem to be working.
new_str = (str.replace('$$_###','<li>').replace('###_$$','</li>');
worked fine, but of course i want a global replacement.
Any help will be deeply appreciated.