match the prefix of the path