Simplify path detecting regexp