We investigate an optimal asset allocation problem in a Markovian regime-switching financial market with stochastic interest rate. The market has three investment opportunities, namely, a bank account, a share and a zero-coupon bond, where stochastic movements of the short rate and the share price are governed by a Markovian regime-switching Vasicek model and a Markovian regime-switching Geometric Brownian motion, respectively. We discuss the optimal asset allocation problem using the dynamic programming approach for stochastic optimal control and derive a regime-switching Hamilton-Jacobi-Bellman (HJB) equation. Particular attention is paid to the exponential utility case. Numerical and sensitivity analysis are provided for this case. The numerical results reveal that regime-switches described by a two-state Markov chain have significant impacts on the optimal investment strategies in the share and the bond. Furthermore, the market prices of risk in both the bond and share markets are crucial factors in determining the optimal investment strategies.