I'm trying to use node to do some regex on a css file.
Here's my javascript:
var fs = require ('fs');
fs.readFile('test.css','utf8',function(error,css){
if(error){
console.log("I'm sorry, something went terribly wrong :o Here's the message: "+error);
}
var matches = css.match(/([a-zA-Z-]+):\s*([0-9]+)(vh|VH|vw|VW)/g);
console.log(matches[2][1]);
});
Expected output when I run it:

Actual output:

As you can see it does not put every match in its own array as expected, it just puts everything in one giant array without any sub-arrays. Anything I can do?