Avoid bad matches on protos.util.filterWithPattern by trimming input