I am trying to remove exclamation marks at the end of a word.
eg. remove("!!!Hi !!hi!!! !hi") === "!!!Hi !!hi !hi"
I am able to remove all exclamation marks, but am unable to target those just at the end of a word.
The following is what I currently have.
function remove(s){
return s.replace(/([a-z]+)[!]/ig, '$1');
}
.replace(/\b!+\B/g, '')