hi, i think they are planaria,
BNs wont eat them, but if you get a lot they are a threat to BN eggs as they will eat eggs.
I found rams and other fish that eat small creatures will eat them BUT they only eat those on show. If you lift some of the stones/caves/ things flat on floor, you will probably find some curled up. the fish cant get at these to eat and they will come out at night to forage. you can eliminate a lot by washing them off. but you prob have some in the filter too so they will spread back.
I found after lots of trials that the only really effecive way was to use the plymouth discus wormer. (jozebs sells it)
they come from almost anywhere. rain water butts, plants, in the water when adding new fish, (babies are very small), etc