日期:2014-05-20 浏览次数:20948 次
<!doctype html> <html> <head> <meta charset="gb2312" /> <title></title> </head> <body> <script> var data = [ 'HistoryProduct_1', 'HistoryProduct_2', 'HistoryProduct_3', 'xistoryProduct_3', ]; var re = /^HistoryProduct_\d+$/i; for(var i = 0, len = data.length; i < len; i++){ document.write( data[i] + ' ------------ '+ re.test(data[i]) + '<br />' ) } </script> </body> </html>