This is intended as a running list of regular expressions explained in simple terms. I’m basing it, at least initially, on its usefulness within Crimson Editor, my Windows text editor of choice, which permits the use of regular expressions in its search and replace.
Find bracketed text, including the brackets:
Crimson Editor
\[([^\}]+)\]
GREP
(\[).*?(\])
This is especially useful when cleaning up MailChimp’s autogenerated text-only versions of e-mail campaigns, wherein links are converted to footnotes.
Find parenthetical text, not including the parenthesis (GREP):
(?<=\().*?(?=\))
Find all leading whitespace at beginning of line:
^[ \t]+
Given a document with image tags on each line, remove everything but the source file paths (tested using Find/Replace with GREP in TextWrangler).
Find:
^.+img.+src="([^"]*)".+
Replace:
\1