099099.com|桂ICP备08000288号|黄俊添
1000gouwu.com|冀ICP备09050878号|康志涛
1001-w1000gouwu.comish.com|辽ICP备09028978号|大连吸引力传媒有限公司
101wm.com|皖ICP备06013913号|许敏和
只需要
099099.com
1000gouwu.com写一段JS代码 

解决方案 »

  1.   

    alert(str.match(/^\d+(?:gouwu)*\.com\b/mg));
      

  2.   

    alert(str.match(/^\d+(?:gouwu)?\.com\b/mg))
      

  3.   


    <script>
    var str = "\
    099099.com|桂ICP备08000288号|黄俊添\
    1000gouwu.com|冀ICP备09050878号|康志涛\
    1001-w1000gouwu.comish.com|辽ICP备09028978号|大连吸引力传媒有限公司\
    101wm.com|皖ICP备06013913号|许敏和\
    ";alert(str.match(/[^\u4e00-\u9fa5]+(?=\|(桂ICP备08000288号|冀ICP备09050878号))/g).join("\n"));
    </script>