I don't mean to sound cold, but you already have all the information you need:
"he said 'she dont matter'"
That's why he keeps doing it and that's why he doesn't care how it makes you feel. All the energy you are putting into the relationship doesn't make up for what he's not putting into it. Save your effort and focus it on yourself instead.