How can I rewrite the regex below so it won't return the square brackets in the results. I have to use match since it's part of other code. Can someone help?
var s = '{[{main}(other data)][{data}(other data)][{address}(other data)]}';
m = 'data'
var qm = function(str) {
return s.match(new RegExp('\\[{' + str + '}\\(.*?\\)\\]', 'gi'));
}
console.log(qm(m)); // returns "[{data}(other data)]"
// trying to get "{data}(other data)" no square brackets