Probably planaria - google search for pics.
Tend to be an indication of excess nutrient/nitrates. Harmless in and of themselves (fish eat 'em) but visually unattractive, and you should test nitrates with a good liquid drop test kit and reduce if in excess of 40 with water change. You may be overfeeding.
Perhaps consider increase your maintenance - how often do you gravel vac & how much water do you change weekly ?