0

I want to substitute the last occurrence of a text with nothing:

let text ="eb8583fb8d0c8aadce-lad7ff779e5e53ee-la.gif"; 
text = text.replace('/(\b-la\b)(?!.*\1)/',"");

taking the above code as an example I want text to be: eb8583fb8d0c8aadced7ff779e5e53ee-la.gif according to this question this should work, but actually not, why?

loxad60236
  • 19
  • 1

0 Answers0