Agreed. I even imagine using two expressions may be slightly faster.

var %x = abcdefg
var %cnt = $regsub(%x,/^.(.)/,4\1,%x)
var %cnt = $regsub(%x,/(.).$/,4\1,%x)
echo -a %x

All three methods are probably worthy of a speed test. I'll try this later today and post the results.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!