I masturbated to a not quite legal girl I know
Why did you have to specify that the girl was not quite legal?
I felt bad for doing it
It is ok to fantastize about things when masturbating, however it is important to identify what is wrong and what is right. Sex with an underage is against the law, so you need to be conscious of knowing that you can never act on an urge like that.
I know that now that I'm looking at it.
I'm glad you know what you did was wrong, because children cannot consent to any sexual acts. This can be a good learning lesson to never do such a thing again, so you won't continue to feel guilty about such things.