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 scaaaaryI felt like doing something scary. *grin* The trick is to use sexeger - a regex that operates on the reversed string.
Don't forget to tune in for the next issue of H.R. Giger meets Perl. *grin*s/{BS}/\b/g; $_ = reverse $_; my $k = 0; s/(\010+)(??{ $k += length $+; "([^\010]{0,$k})" })(?{ $k -= length $+ + })//g; $_ = reverse $_;
Makeshifts last the longest.
|
|---|