This evening I’ve learned to use regular expressions in sql code, and I’m loving it. Talking with GoLo about this, he showed me how to use regular expressions on the Vim´s search and replace tool (Instead he doesn’t like Vim :P ). E.g. If you want to comment some lines of code, you may want to use:

[sourcecode language='css']
:4,9 s/^/\/\/ /g
[/sourcecode]

Where 4 and 9 are the lines between which you want to comment on the code, ^ is what you must use to go to the begin of the lines and \ allow us to insert the /. This would be more efficient if you record it into a macro.

This is a very extensive topic, and this is only a minimal part of it. If you want to learn more about it, you can  read this tutorial.