in reply to Re: I don't remember regex seeming this hard before
in thread I don't remember regex seeming this hard before

Or, to be (arguably) less ugly and do a little less work,
s/([<>]+[^<>]+)/($k+=($1=~y#<##)-($1=~y#>##)) ? uc $1 : $1/ge;

We're not really tightening our belts, it just feels that way because we're getting fatter.