I am reading in a file line by line in js and looking for any string within quotes, as follows:
// regex to find all strings within double-quotes
var re = new RegExp("\"([^\"]*)\"");
// parse each line in inFile
var lineReader = require('readline').createInterface({
input: require('fs').createReadStream(inFile)
});
lineReader.on('line', function(line) {
var res = line.match(re)
// do something else here
});
This works great if there is only one string on each line within quotes. How can I adapt it to iterate over multiple matches on the same line?
Thanks