I’m having some problems with regular expression
Here is the code:
var interpolate = /{ .* }/g
var data = "{ name } { roll } data { app }"
console.log(data.match(interpolate))
I expect the output to be ["{ name }", "{ roll }", "{ app }"]
But when I actually run it, I get the complete string as output,
i.e:
[Running] node "/home/mayukh/Desktop/Projects/tests/regular.js"
[ '{ } { roll } data { app }' ]
I don’t know what exactly is happening.