How can I get or extract some string part from url jquery

JavaScript
var citySearch = $.cookie('recentSearch');
citySearch.match(/_keywords=(.+)/)[1] 
var citySearch = $.cookie('recentSearch');
citySearch.match(/_keywords=(.+?)&/)[1]

Source

Also in JavaScript: