I'm trying to replace multiple matched groups based on a regex like this
var paramRegex = /{\s*\[(\w*)\]\s*(\w*)\s*\(([\w\s]*)\)\s*}/i;
// should match {[group1] group2 (group3)}
var emptyParam = '{[]()}';
emptyParam.replace(paramRegex, 'a $1 b $2 c $3');
why does this result in 'a b c' ? Why have the brackets, curly braces and parantheses disappeared ?
I was expecting this to print '{[a]b(c)}'