Gustavo Benedito Costa
collator = new Intl.Collator('es', {
caseFirst: "lower",
ignorePunctuation: true,
localeMatcher: "best fit",
numeric: true,
sensitivity: 'variant',
usage: 'sort'
});
document.write(
["3", "2", "10", "40", "6", "4", "30", "33", "1", "Gustavo", "julho", "Klaus", "Ιαπωνία", "keyboard", "სკოლა", "último", "árbol", "γυναίκα", "uma", "água", "argentina", "Ángelo", "argelino", "unido", "женщина", "κήπος", "друг", "дом", "ბაღი", "люди",].sort(collator.compare)
);
this 'work' as far as that it can order the letters accordingly BUT .... ofc there is a but
console.log(['a', 'à'].sort(collator.compare));
console.log(['àb', 'az'].sort(collator.compare));
so I guess there will be some manual work you need to do. in theory you can do a presort as you did before so the 'normal' ordering works and than use
String.prototype.localeCompare()
to reorder them based on the first letter of the string in a second iteration than you don't need some regex :).
does this help?