in reply to Re: Re: Re: Re: Re: Re: Reply

use Perl::Golf; sub re{ $_=pop;s/Re:\s*/\x01/g;s/Re(\d+):\s*/"\x01"x$1/eg;s/(\x01+)/"Re". length($1).": "/e;$_; }
As in: print re("Re: Re: Re: Re: Re: Re: Reply\n"); Returns: Re6: Reply

Replies are listed 'Best First'.
Re^8: Reply
by ChemBoy (Priest) on Jun 08, 2001 at 20:52 UTC

    Untested code, for shame... the following is for the simple case only: it breaks on "Re: Re^4: foo". But unfortunately, so does yours ;-)

    sub re {$a=()=pop=~/Re:\s*/g;"Re^$a: $'"}

    Unfortunately, this is short because it completely catipulates on a couple of issues, specifically "Re: Re^3: Foo" and "Re: bar". I've been trying to get the complex case to behave, and it hasn't been.

    Perhaps we should move this over to a more normal place for it?



    If God had meant us to fly, he would *never* have give us the railroads.
        --Michael Flanders

      No it doesn't(break Imean). He uses another format. He could easily include the ^ in his format. But you can't use his format either.