Hi,
I have used the below code but it shows invalid quantifier error.
Code:
<html>
<body>
<script type="text/javascript">
var str="c++";
document.write(str.replace(/"+"/g,/"\+"/));
var s=str.replace(/"+"/g,/"\+"/);alert(s);
var sss=str.toString().search("\""+s+"\"");alert(sss);
</script>
</body>
</html>
The string c++ is not replaced as "C\+\+".I don't know where is the issue.