2 Corinthians 7:9-10

9 I now rejoice, not that you were made sorry, but that you were made sorry to repentance. For you were made sorry in a godly way, that you might suffer loss by us in nothing.  10 For godly sorrow works repentance to salvation, which brings no regret. But the sorrow of the world works death.