Match paths against a regex