Inspect the shape of the head to see if it triangular. Even more so, the presence of eye spots. If so, then most likely planaria. Otherwise, some species of flat worm (would not worry about those).
If there are a few I like to spot treat them with Excel or other similar product. Upon contact they shrivel up and die immediately. For several planaria, a planaria trap can be used (purchased or DIY). For infestations, fenbendazole (canine dewormer) is highly effective. Wipes out hydra as well. I used it to treat a shrimp tank that had snails as well. Planaria gone, snails and shrimp are fine. There are also planaria specific remedies out there. This one is herbal:
http://greenleafaquariums.com/products/no-planaria-worm-disinfectant.html