I have a filename that can have multiple dots in it and could end with any extension:
tro.lo.lo.lo.lo.lo.png
I need to use a regex to repla
Use \. to match a dot. The character . matches any character.
\.
.
Therefore str.replace(/\.([^\.]*)$/, ' @2x.').
str.replace(/\.([^\.]*)$/, ' @2x.')