Woe is me!

Whilst studying Latin at school I was taught an expression "O me miserum!" which we translated to the expression "Woe is me!". Is there a connection?