in reply to Re: Cleaning the Log
in thread Cleaning the Log

perl regexes _may_ be able to handle this, but the code would be scaaaary
I felt like doing something scary. *grin* The trick is to use sexeger - a regex that operates on the reversed string.
s/{BS}/\b/g; $_ = reverse $_; my $k = 0; s/(\010+)(??{ $k += length $+; "([^\010]{0,$k})" })(?{ $k -= length $+ + })//g; $_ = reverse $_;
Don't forget to tune in for the next issue of H.R. Giger meets Perl. *grin*

Makeshifts last the longest.