我在javascript中有一个对象-:
var array = {"1":"John","2":"Caprio","3":"David","4":"Edward"}
我想做这个 -:
var message = 'Wats up David#1. Are you with David#5 or Caprio#89';
$.each(array, function(key, value){
var matchMe=value+'#'+anywholenumber;
if(message.match(matcheMe))
{
var ge = new RegExp(matchMe, 'g');
message = message.replace(ge,'['+matchMe+']');
} });
我该怎么做?非常感谢您的帮助