Let the flame wars commence. I use Vi Improved.
Even though I had downloaded Emacs first (by a couple years), Vi was the first heavy-weight text editor that I learned. What is scary about these editors is just how obscure you can make your commands. Here is one that I’ve used a few times recently:
:%s/=\([a-zA-Z0-9][^>" ]*\)/="\1"/g
Any guesses what it does? The “a-zA-Z0-9” part is probably the most readable. It is a regular expression (also called a “regex”) and was designed for HTML pages that do not have the tag parameters quoted.
The line above finds equal signs with alpha-numeric characters immediately following them (that is not quoted!) and replaces it with quotes in the proper place. the /g at the end makes it replace all tag parameters that are on each line.
“\1” references the first data found in parentheses, which Vi requires to be escaped like this: (some text). The square brackets let you define the range of a single character, while adding a * to the end allows that “character range” to match zero or more characters. The second character range above automatically flags the end of the capture when a space, quote, or close tag character is found.
Confused yet? They can be complicated enough that some new students have called them a “write-only” coding language because they couldn’t decipher them afterward. I’ve been using regular expressions for the last four years and can assure you that it is possible to read them and comprehend what they do.
If you need a good starting point, Araxis has a good reference page. When on linux, you can also use “man 7 regex” to find the regex part in section 7 of the manual. They are worth learning.