Match a path against multiple patterns.