I have a JSON file which contains data like the following:
{\"posts\": [ { \"title\":\"1\", \"url\":\"n1.png\" }, { \"title\":\"2\", \"url\":\"n2.p
try this
var q = new RegExp(req.query.q,'i'); posts = posts.filter(function(item){ if(item.title.match(q) || item.url.match(q)){ return item; } });