remove the last dot and all text beyond it in string `s`,"re.sub('\\.[^.]+$', '', s)"