It comes from the Greek word "rhye", meaning "to regret" or "to lament".
However, it's important to note that the word "rueful" itself is not directly derived from Greek. It comes from the Middle English word "rewful", which itself has roots in Old English and ultimately from the Germanic word "hruwian", meaning "to sorrow".
While the Greek root "rhue" is related to the concept of regret, it's not the direct origin of the word "rueful".