Ya, I believe its just planaria worms. They're not harmful to your fish & if you want to get rid of them just stop feeding your fish for about 2 days (this won't harm your fish because wild fish have days where they have to go without food and that doesn't harm them) and keep up with your weekly water changes and clean the gravel really well
http://www.****************/information/having_trouble_p2.htm
and here is a little information I found on them which I took directly from algone.com's website,
"Noticing small white worms the size of a few millimeters crawling along the glass are either flat or roundworms. Flat appearances are planaria (flatworms) and the more thin and wiggly ones are nematodes (roundworms). Both of them do not exceed 4-5 millimeters. Both types are harmless to fish and thrive on excessive waste in the water column.
To free the tank of these worms simply do not feed your fish for 3-4 days as they will often feed on them."