testString = \"something://something/task?type=Checkin\"; patt = new RegExp(\"something\\/(\\w*)\\?\"); match = patt.exec(testString); document.querySelector(\'#resultR
try with this: var pat = /something:\/\/(?:[^\/]+\/)+(\w+)\?(\w+=\w+)/;
var pat = /something:\/\/(?:[^\/]+\/)+(\w+)\?(\w+=\w+)/;
it can match string such as:
something://something/task?type=Checkin something://something/foo/task?type=Checkin something://something/foo/bar/task1?type3=Checkin4