I have a string like this,
green open calldetails 1 0 4 0 10.7kb 10.7kb
green open stocksummary 1 0 3 0 8.6kb 8.6kb
I need to obtain Stocksummary and calldetails from this. This is what i have tried using regex,
var result = string.match(/(?:open )(.+)(?:1)/)[1];
Here is my full function:
routerApp.controller("elasticindex",function($scope,es){
es.cat.indices("b",function(r,q){
String St = string.match(/(?:open )(.+)(?:1)/)[1];
console.log(r,q);
});
});
Desired Output:
calldetails
stocksummary