in reply to Re: using lookaround assertions to grab info
in thread using lookaround assertions to grab info
splitting the scalar on /\n\b/ does the trick. It "slurps" the subsequent lines that don't start with a word into the previous label's value. From then on it is just a matter of removing the newlines and the redundant colons.label one: somevalue label two: a very long value : that does not fit on one line so it continues : on another line label thr: someother value
That said, I have much to learn from your regexp
very neat use of 'next unless'.$line =~ /^\s*(\w+)?\s*:\s*(.*)$/; next unless $1 || $2;
Thanks for the help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: using lookaround assertions to grab info
by dragonchild (Archbishop) on Jun 04, 2004 at 12:48 UTC |