why it is showing two i's "ii" instead of a single "i"
Code:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>
<script>
var str="-1,.05,+1000,3.1415926535,42.";
document.write(str);

var chng=str.replace(/[+-]?\d*\.?\d*/g,"i");
document.write(chng);
</script>
</body>
</html>