Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Title Re: collapsing revisited

by Aristotle (Chancellor)
on Jun 08, 2002 at 21:38 UTC ( #172841=note: print w/replies, xml ) Need Help??


in reply to Title Re: collapsing revisited

This works against all your test cases.
sub re_collapse { local $_ = $_[0]; # explode all collapsed in one go s{Re.(\d+).?: } { "Re: " x $1 }ge; # re-collapse (no pun intended) s{ ( (?:Re:\ ) {2,} ) } { "Re(" . length($1)/4 . "): " }xge; return $_; }
A dedicated re_add seems pointless to me since you want to collapse all existing "Re:"s at that point anyway, so I suggest just passing it "Re: $title"; it seems cumbersome to me to implement that functionality using extra code.

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://172841]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2021-07-26 16:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?