how can I split these strings so that I get the results below? I want to be able to do something like this:
alert(img/small/Closed-Main-Fabric-Collar_2018.png.replace(/\-/g, ' '));
this would alert: Closed-Main-Fabric-Collar but I need it to work even if the sting has an extra /mid/ I'm pretty sure I will need two replace functions one to get the "Closed-Main-Fabric-Collar" and one to get the "2018"
1. img/small/Closed-Main-Fabric-Collar_2018.png
2. img/small/Base-Shirt_2016.jpg
3. img/small/mid/Outside-Pocket-Left_2019.png
4. img/small/large/Outside-Pocket-Left_2019.png
1. Closed-Main-Fabric-Collar
2018
2. Base-Shirt
2016
3. Outside-Pocket-Left
2019
4. Outside-Pocket-Left
2019
Thanks!