Mode confinement in periodic and aperiodic PBG cavities