http://localhost/OvmWeb/OvmHistoryTrendDataDisplay.aspx?index=2
怎样在js里用正则表达式截取得到OvmHistoryTrendDataDisplay
要通过//和/

解决方案 »

  1.   

    http://localhost/OvmWeb/(?<g1>.*?).aspx?index=2 
    取g1的值
      

  2.   

    http://www.cqzol.com/programming/270254.html
      

  3.   

    能不能详细一点,localhost、OvmWeb不是固定的
      

  4.   


    (?i)(?<=http://[^/]*/).*?(?=\.aspx)
      

  5.   


    @“(?i)(?<=http://[^/]*/).*?(?=\.aspx)”
      

  6.   

    try...<script type="text/javascript">
        var str = "http://localhost/OvmWeb/OvmHistoryTrendDataDisplay.aspx?index=2";
        var reg = /[^\/.]+(?=\.aspx)/i;
        document.write(str.match(reg)[0]);
    </script>