You know what they are so I am assuming you have at least looked up a little about what causes them and found out they are harmless, so why are you so willing to throw chemicals that will cause unknown results into your tank????
No need for chemicals, especially meds that you have no clue about whether they work or not.
Planaria are a natural part of any tank, every fish tank has them to a degree. It is just normal not to see them, think of them showing up all over your glass and even being able to see them floating around as an alarm system telling you that something is wrong.
Their population only explodes when something has gone wrong, usually something that the fish keeper has full control over.
The usual suspects are overfeeding and a very slack water change/gravel vac regime, either together or separate.
It is also worth taking a peek under ornaments and inside caves for any dead fish as this will constitute extra food.
A fourth cause to look at if the more common things are taken care of is filter maintenance. The one area that is usually left for a very long time between cleanings. They feed on the extra food and detritus that is collected in the filter sponges.
Once you get on top of the problem which will be one of those mentioned then the population will quickly die away, within a few days usually.