match function that accepts an array of paths and keywrod