Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Scaring the Log

by Aristotle (Chancellor)
on Sep 03, 2002 at 14:34 UTC ( [id://194779]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://194779]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2025-03-24 18:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (65 votes). Check out past polls.

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.