Text this: A Legendre–Galerkin spectral method for option pricing under regime switching models