While I was repotting my rosemary, I discovered several, fairly large, worm-like creatures (see images below; I found more after taking the picture, but they look the same as the other ones). For reference: the biggest ones in the image are about 4cm in length while crawling forward.
Does anyone know what kinds of creatures these are? And do I need to worry about them? Considering their size, I'd imagine they have to be harmful in some way or another. Unless they're earthworms, but they don't quite look like the earthworms I've seen before, and even if they are, I don't think they'd thrive in a pot without harming the plant. Either way, I doubt that I found all of them, much less their eggs (whatever those might look like).
For reference: I live in southern Germany, and the pot is inside my apartment in front of the south window (though I doubt that matters for the worms).
Addendum: turns out one of the worms looks significantly different from the others, instead of just being a smaller version. Here's the image: