Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Title Re: collapsing revisited

by tadman (Prior)
on Jun 08, 2002 at 15:36 UTC ( #172792=note: print w/replies, xml ) Need Help??


in reply to Title Re: collapsing revisited

Great effort, but what about "depersonalising" the title as well? While some find it valuable to put their handle in the reply title, these are often left in there by careless responses. So, what you have is Re: (bob) Re: Donut instead of what should be Re(2): Donut.

BTW, $&? Yikes.

Replies are listed 'Best First'.
Re: Re: Title Re: collapsing revisited
by Dog and Pony (Priest) on Jun 08, 2002 at 15:48 UTC
    Well, I guess that could be done, as another user setting. Something like
    s{(?<=Re:) \(\w+\)}{}g;
    might even get the job done, although I haven't tried it enough. And then you put it through the collapse sub to put those Re:s together.

    $& has its uses too, in this case it was the best way I could come up with. ;-)


    You have moved into a dark place.
    It is pitch black. You are likely to be eaten by a grue.
      I suppose what I was wondering was why you left your match unmemorized, and then used $&. I've been lead to believe that's bad form, since once you open that Pandora's box ($`, $& and $'), all your regexes become slower as a result.
        Oh. I had actually forgot that. Do you know if that is the same thing with @- and @+? I can use those instead, at the price of higher obfuscation... :)

        Thanks for the heads up!

        (I just *had* to change the Re: style *grin*).


        You have moved into a dark place.
        It is pitch black. You are likely to be eaten by a grue.
      Like tadman++ noted the problem is that once you use it, all regexes anywhere in the script become slower - not likely to be tolerable in the context of the Everything engine.. And this one in particular is pretty simple: $title =~ s{((?:Re: ){2,})}{"Re(" . length($1)/4 . "): "}ge; Works a treat for your test cases.

      Makeshifts last the longest.

Re: Re: Title Re: collapsing revisited
by belg4mit (Prior) on Jun 08, 2002 at 18:25 UTC
Re: Re: Title Re: collapsing revisited
by educated_foo (Vicar) on Jun 10, 2002 at 02:31 UTC
    Actually, if we could just all agree to get rid of "vanity re's" like "*Re" and "(its_me) Re" entirely, we would be much better off re-wise. It's terribly re-dundant.

    /s

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2021-08-04 17:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (42 votes). Check out past polls.

    Notices?