D.P.
#1 -- I disagree with soap as a punishment. It teaches kids that parents can do mean things to them -- not to avoid a word.
#2 -- he's young enough yet that this can be easily changed. It just takes perseverance. Explain that the word he uses is not to be used -- you don't like to hear it -- it makes mommy very sad when he says it. Offer an alternative. My little one picked up "dammit" (from me -- ooops!) and I did that with her. I told her that she should say, "Oh rats! Oh phooey!" So, everytime she or I got upset or were unhappy about something, we said, "Oh rats! Oh phooey!" If I dropped something, if her toy weren't doing what she wanted it to do, anything. So, I had to retrain ME too. But it was worth it. And now, at 5 and a half, she still says, "Oh rats! Oh phooey!"
Much cuter than obscenities!
Good luck!