We prove Anderson localization in a disordered photonic crystal waveguide by measuring the ensemble-averaged localization length which is controlled by the dispersion of the photonic crystal waveguide. In such structures, the localization length shows a 10-fold variation between the fast- and the slow-light regime and, in the latter case, it becomes shorter than the sample length thus giving rise to strongly confined modes. The dispersive behavior of the localization length demonstrates the close relation between Anderson localization and the photon density of states in disordered photonic crystals, which opens a promising route to controlling and exploiting Anderson localization for efficient light confinement.