in reply to Trim Two Characters On Line
perl -le 'for(@ARGV){ s/(?=SUM).*\K..//; print }' abcSUMcdexx abcSUXcd +exx abcSUMc [download]
Outputs:
abcSUMcde abcSUXcdexx abcSU [download]
( borrowing bits and pieces and ideas from other monks... )