in reply to Regexp magic needed, truncate incomplete XML

For this example, assuming you've got all three lines stored as one string in $_:
s/^.*[^>]$//gm;
That will delete any lines that don't end in a >. It will leave the newline from those lines, though. Season to taste.

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^2: Regexp magic needed, truncate incomplete XML
by Anonymous Monk on Nov 24, 2005 at 09:02 UTC
    Great, just the trick I was looking for. I got too caught up in it being the last record that I didn't think to replace incomplete lines.

    Thanks.