How to replace "i" in <li>anything</li>
using regex
Code :
var code = "<li>anything</li>"; // i don't know what is in <li>......</li>
result should be :
var code = "<li>anyth1ng</li>"; // i don't know what is in <li>......</li>
How to replace "i" in <li>anything</li>
using regex
Code :
var code = "<li>anything</li>"; // i don't know what is in <li>......</li>
result should be :
var code = "<li>anyth1ng</li>"; // i don't know what is in <li>......</li>
With the information you gave us, these should work:
code = code.replace(/hi/g, "he");
code = code.replace(/i\</g, "e<");
If you have more requirements, please update the question to describe them.
Updated
var code = "<li>hi ho hi ho it's off to work we go</li>";
code = code.replace(/\>.*\</g, function(m) {
return m.replace(/i/g, "e");
});