I really know what you mean here...
I was fine with confidence until I started going out with my boyfriend of two years, he's the first person I've loved like that and I want to be his perfect girl, I know it should really be the other way round confidence-wise, I think I just have more to lose now.
As for how to get your confidence up, it might sound silly, but laugh loads! Even if you have to force laughter or smiling, it releases endorphins which make you feel better. Also, do you do any sports? If not, it might be an idea. Firstly, it can really tone up your body and it also makes you feel great after a long workout or session. Does the job for me XD
Also, aim to try and see something good about yourself every day. Your last two boyfriends clearly didn't help with this, but high chances are, you have several particularly nice things about you, I've never met you so I wouldn't know, but you might have a lovely smile, you might have nice eyes, might even be something as simple as you're a friendly person. Try and see yourself positively!
Being critical of yourself can be such a slippery slope.
Also, remember that these girls you're seeing out and about will almost certainly have hang-ups of their own, and plenty of them too. There are very few people out there who think they're perfect.
Good luck! ^_^