Reinforcement learning for continuous-time mean-variance portfolio selection in a regime-switching market