I have a simple regular expression:
str.match(/SK=([\w\-]+)/i);
I would like the SK part to be dynamic so I can return the match for SK=, WP= etc...
So I'm looking for something like:
var attr = 'SK';
str.match(/' + attr + '=([\w\-]+)/i);