Frodo:
I wish the ring had never come to me. I wish none of this had happened.
Gandalf:
So do all who live to see such times, but it is not for them to decide. All we have to decide is what to do with the time that is given to us. There are other forces at work in this world surely beside the will of evil. Bilbo was meant to find the ring. In which case, you also were meant to have it, and that is an encouraging thought.
That is definitely the exact wording in the movie.
And
'I wish it need not have happened in my time.' Said Frodo
'So do I,' said Gandalf, 'and so do all who live to see such times. But that is not for them to decide. All we have to decide is what to do with the time that is given us. And already, Frodo, our timeis beggining to look black. The Enemy is fast becoming very strong. His plans are far from ripe, I think, but they are ripening. We shall be hard put to it. We should be very hard put to it, even if it were not for this dreadful chance.'
-- Gandalf,
J.R.R. Tolkien,
Fellowship of the Ring, Second chapter,
The Shadow of the Past