string.search
string.match
string.substring
string.toLowerCase
string.localCompare
parseInt
function solution(files) {
return files.sort((a,b)=>{
const regex = /[0-9]/; // 숫자를 나타내는 정규식
const aIndex = a.search(regex);
const bIndex = b.search(regex);
if(a.substring(0, aIndex).toLowerCase().localeCompare(b.substring(0, bIndex).toLowerCase())!==0){return a.substring(0, aIndex).toLowerCase().localeCompare(b.substring(0, bIndex).toLowerCase())}
if(parseInt(a.match(/\d+/g)[0])<parseInt(b.match(/\d+/g)[0])) return -1;
if(parseInt(a.match(/\d+/g)[0])>parseInt(b.match(/\d+/g)[0])) return 1;
return 0;
});
}