in reply to Regex help

s/_$//; The dollar anchor associates underscore with end of string.

After Compline,
Zaxo