Undigested bananas and undigested foods have irregular shape, while flukes and other worms have very regular shape and can easily be identified and recognized inside feces.
Most of the objects on the next pictures show undigested food, definitively not worms or flukes: