ar str ='https://xx.eerr.com/design/certified?channel=mtxxswaa888&bd_vid=xxx' var reg = /([^?&=]+)=([^?&=]+)/g while(res = reg.exec(str)){ console.log(res); }