What is done is done and it will never be undone. The only possible thing to do instead is just sobbing and showing regret if the things done or missed were not part of one's expectations. Don't worry, there are plenty of ways to express regret!
However; before we can tackle the subject, allow me to advise you to do the right deed for the right reason, then you won't need to be sorry or to regret anything.
People make mistakes. They are not perfect but to certain limits. Stupidities are not to be classified in the category of fate. Don't rush to do things for fear you should regret them for all the rest of your life.
You are a student and you are supposed to listen to your teacher, to ask her for clarification if you don't understand something, to do your homework and to revise your lessons regularly. In brief, to work hard.
There will be nothing to regret or to be sorry for even if you don't succeed because you did what you had to as a serious and committed student.
Regret is expressed after you did something you shouldn't have done or you didn't do something you should have done. We never regret things we were not responsible for.
Expressing regret is as tough as apologizing. Yet it is quite human to admit one's faults.
You didn't do your homework and the teacher is angry with you!
I ought to have done it. (said to the teacher)
I should have done it. (said to the teacher)
If only I had done my homework. (said to yourself)
I wish I had done my homework. (said to yourself)
You did a stupid mistake and the teacher is mad about it!
I'm sorry, I oughtn't to have made such a mistake. (said to the teacher)
I shouldn't have made such a mistake. (said to the teacher)
If only I hadn't made such a mistake. (said to yourself)
I wish I hadn't made such a mistake. (said to yourself)
should (not) have + verb in the past participle.
ought (not) to have + verb in the past participle.
if only + Past Perfect
wish + Past Perfect
I wish I had been more careful. (but in reality I wasn't and I regret it now)
If only I hadn't told her those hurting words.(but I did)
I oughtn't to have driven fast.(but I did)
I should have been punctual. (but I wasn't)
I wish I had warned him. (but I didn't)
What should they say in these situations?
Someone who had an accident because he drove fast.
Someone whose wife left him because he was a gambler.
Someone who didn't tell the truth and went to jail.
Someone who said "No" and regretted it.
Someone who was offered a job and refused it and he regretted it.