Shouldn't this RegExp work?

后端 未结 4 577
醉酒成梦
醉酒成梦 2021-01-27 02:37
testString = \"something://something/task?type=Checkin\";

patt = new RegExp(\"something\\/(\\w*)\\?\");
match = patt.exec(testString);
document.querySelector(\'#resultR         


        
4条回答
  •  日久生厌
    2021-01-27 03:14

    This is what you need:

    patt = new RegExp(".*/(\\w*)\\?");
    

    http://jsfiddle.net/FJcfd/

提交回复
热议问题