in reply to Re: using lookaround assertions to grab info
in thread using lookaround assertions to grab info
Your code seems to produce correct values, but not quite. More on that in a bit. But, since I am an acknowledged noob, I will have to spend quite a bit of time staring at...
...to figure out what is going on. I will do that and hopefully learn something, but at first glance it seems a bit beyond me for now.$parts{ $1 } = $2 while $m =~ m[ (?: \A | \n ) ( [^:]+ ) \s* : (.*?) (?= (?: \n \S [^:]* : ) | \Z ) ]gxs;
That said, the result is not what I want. Here is how --
All that said, Roy Johnson's suggestion of splitting the lines on /\n\b/ set me on the right path and did the trick.# You have 'Remarks' => ' DIRECTIONAL BORING=NO. DEPTH EXCEEDS 7 FEET=NO. : TICKET EXPIRES AFTER 04/22/04', 'Dig No ' => ' A081 Prior: 2 Digstrt: 03/30/04 Time: 10:45' # # I want 'Remarks' => ' DIRECTIONAL BORING=NO. DEPTH EXCEEDS 7 FEET=NO. TICKET +EXPIRES AFTER 04/22/04', 'Dig No ' => ' A081', 'Prior' => 2, 'Digstrt' => '03/30/04', 'Time' => '10:45'
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: using lookaround assertions to grab info
by BrowserUk (Patriarch) on Jun 04, 2004 at 03:22 UTC |