An optical spectroscopic survey of the 3CR sample of radio galaxies withz