How to use variables inside regexp(to check the existence of a substring ) taking in consideration the following example
var hash = '!price=475;1500&ram=475;1275';
var uri_params = ['price', 'display', 'ram', 'hdd', 'brand'];
$.each(uri_params,function(index, param){
console.log(param);
if(/( !param(.*)|¶m(.*))/i.test(hash)){
console.log('test');
//than here I should add the new value to matched param
}
});
if(hash.match(new RegExp('!' + param + '(.*)|&' + param + '(.*)'))