configure: fix filter() function when matching multiple patterns