Dearest of LJGenies....
I have a regular expression problem I'm trying to solve.
The first part was easy.. the second not so easy...
I'll put it behind a cut to spare people the code foo...
A note, my regex mechanism is an application called BBEdit. It's basically using greppy regex. Parens loop capture text, \n references the capture text in order of the parens.
I have the following text:
Do something else
Do something entirely different
I've figured out the following without any problem:
As a result I can easily do:
The trick is I am shooting for
where foo is the heading (FOOO | GLAR) to allow me to format depending on which one.
Unfortunately this isn't quite working:
that clusters the entire unit but I have no way to step thru the individual captures of (now) \2 to distribute the \1 into the replace.
Confused? Ideas? Waaah!