I'm trying to find a good regex to use with TextWrangler to parse task descriptions into a Rememberthemilk.com format: so that a line like:
Example task section 1 section tomorrow section tagone tagtwo tagthree tagfour
whould convert into the RTM format:
Example task !1 ^tomorrow #tagone #tagtwo #tagthree #tagfour
Now this gets me into the question of, how do you capture an infdefinitely-repeating pattern using the right syntax in the backreferences?
I've been trying this regex:
^([\w ]+) section (\d) section (\w+) section ((\w+) )+$
which seems to capture the format of the input text, but I just don't know how to make the conversion in the backreferences?
\1 !\2 ^\3 #(???)
How do I achieve this?