TextWrangler

TextWrangler is a free, Mac-only text editor with advanced features such as regular expression find and replace, syntax coloring, line numbering, etc., making it an excellent free choice for programmers.