JSFiddle - React, Tailwind, and code Playground
JavaScript
var files = ['BRL0368 Side.jpg', '5510 Dura Guard Carpet.jpg'];
var convertedFiles = [];
for(var i=0,l=files.length;i<l;i++)
convertedFiles[i] = files[i].replace(/(^[^\s]+).*?(\.\w+)$/,'$1$2');
alert('your files were converted from : ' + files.join(', ') + ' to ' + convertedFiles.join(', '));