I have a URL that always ends with the number 30. I want to replace that with another number 100. I am not sure if regex is the best option and if so, how to do it? This is my attempt, but I am looking for something more professional that would work in any situation and only change the last bit of the URL that has 30.
let URL = "https://is5-ssl.mzstatic.com/image/thumb/Music/v4/5c/5a/a0/5c5aa0fd-978e-b038-3918-f6127f97295e/source/30x30bb.jpg";
URL.replace("/([30])\w+/g", "100");
Thanks in advance.

URL = URL.replace('30x30', '100x100')?URL.replace('/30x30', '/100x100')just to decrease the risk of "30x30" showing up elsewhere, such as in the string that looks like a hash.I have a URL that always ends with the number 30. I want to replace that with another number 100.i guess op is talking about only last one not bothhttp://somewebsite30.com/30x30.jpghttp://somewebsite30.com/40x30.jpgorhttp://somewebsite30.com/30x40.jpg?