Hi Glen,
regex is extremely powerful but quite slow. Test the perfromance difference of
REPLACE FIRST OCCURRENCE OF REGEX '(.*)#$' IN lineWITH '$1'
against
SHIFT line RIGHT DELETING TRAILING CL_ABAP_CHAR_UTILITIES=>NEWLINE. "or CR_LF
The character displayed as '#' is probably a contraol character, check out the CL_ABAP_CHAR_UTILITIES attributes.
Regards Clemens
.