O.P. Problem with RegExp + Replace
i want to do something really simple - to locate numbers for calculation
function...
var reg_exp = "([0-9\*\/+\-()]*)";
if( Messege.match( new RegExp(reg_exp) ) ){
return Messege.replace(new RegExp(reg_exp,'gi'),"[$1]");
}
...
Using the function above, should do this :
input : "Havelåge 5+5+5-(5*6) sdsd"
output : "Havelåge [5+5+5-(5*6)] sdsd"
but instead it : "[]H[]a[]v[]e[]l[]å[]g[]e[] [5][]+[5][]+[5][]-[]([5][]*[6][])[] []s[]d[]s[]d[]"
what am i doing wrong ???
|