We consider the bond valuation problem when the short rate process is described by a Markovian regime-switching Hull–White model or a Markovian regime-switching Cox– Ingersoll–Ross model. In each of the two short rate models, we establish a Markov-modulated exponential-affine bond price formula with coefficients given in terms of fundamental matrix solutions of linear matrix differential equations.