let txt = `Raining cats and dogs. Raining cats and dogs. 1. Raining cats and dogs 22.`, reg = /\d+\.$/mg; txt = txt.replace(reg, ''); alert(txt);