If you’re getting started in programming, or you just need a way to sanitize text you copied before pasting it into a web editor, you will want to look at TextWrangler from the guys at Bare Bones Software.
While the interface is considered dated by some, it still has one of the best grep-based multi-file search and replace tools available on a Mac editor, and one of the best file comparison tools I’ve seen. It’s also free, and available via the Mac App Store.