日期:2014-05-16 浏览次数:20449 次
<!DOCTYPE HTML> <html> <head> <meta charset="gb2312" /> <title></title> <style> </style> </head> <body> <div id="t"> urls[i]='/art/303578.html';headers[i]= .................. urls[i]='/art/403578.html';headers[i]= </div> <script> function $(el){ return typeof el == 'string' ? document.getElementById(el) : el; } var str = $('t').innerHTML; var re = /urls\[i\]='([^']+?)'/gi; var tmp = []; str.replace(re, function($){ re.test($); re.lastIndex = 0; tmp.push( RegExp.$1 ); }) alert( tmp ) </script> </body> </html>
------解决方案--------------------
/'([^\']*?)'/
------解决方案--------------------
urls.*?=['"]?(.*?html)
------解决方案--------------------