$p$-regular analytic spaces and cohomology