标签:
<div class="two">1111</div> </body> <script type="text/javascript"> var x = ‘123;aaa=bbb23232;‘; var m =‘aaa‘; var e = "(;|^)"+m+"=([^]*)(;|$)"; // var e = "(^|;)"+m+"=([^]*)(;|$)"; // var e = ‘[;]‘+m+‘=([\w]*)[;]‘; var reg=new RegExp(e); var res= x.match(reg); // console.log(reg.exec(x)) console.log(RegExp.$2) console.log(res) </script> </html>
标签:
原文地址:http://www.cnblogs.com/yangxiaomie/p/5000129.html