Ease hand coding your HTML with Textmate
So, we've got this horrid plain text list which needs tagging up into links.
1–5, 1–14, 5–3, 5–11, 5–34, 5–37, 5–44, 11–2, 11–16, 11–17, 11–18, 11–19, 11–20, 11–21, 11–24, 11–25, 11–27, 11–29, 11–30, 11–32, 11–34, 26–11, 26–12, 26–13
With the help of the regular expression find and replace built into Textmate we can sort this out in a jiffy.
Find: (\d+)–(\d+)
Replace:
$1-$2
Helps us out with the following output:
1-5, 1-14, 5-3, 5-11, 5-34, 5-37, 5-44, 11-2, 11-16, 11-17, 11-18, 11-19, 11-20, 11-21, 11-24, 11-25, 11-27, 11-29, 11-30, 11-32, 11-34, 26-11, 26-12, 26-13
Neat huh?
We used the \d expression to find numbers, but we could have used . to find any character. + means one or more. The brackets denote each variable which we can then use chronologically i.e. the first bracketed set can be used in our replacement string as $1, and the second set as $2.
More at: http://manual.macromates.com/en/regular_expressions