最佳答案
如何创建与变量连接的正则表达式模式,如下所示:
var test ="52";
var re = new RegExp("/\b"+test+"\b/");
alert('51,52,53'.match(re));
Thanks