fix regex from matching connected