以下的id 168应该找不到,但却match了
如果把开头的\[去掉就会正确,找不到id 168
正规哪里错?<html>
<head>
<script>
function test2(id) {
var thedata = "This is the hello [photo_167][photo_169]world program";
var _regex = new RegExp( '\[photo_'+id+'\]','i');
if(thedata.match(_regex)!=null){
alert(id+' match');
}
}
</script>
</head>
<body>
<script type="text/javascript">
test2('167');
test2('168');
test2('169');
</script>
</body>
</html>