Thank you. In the end I managed to do a similar thing
- search and replace w/ notepad++, basically turning the link list into a two column ods file, one with the url and one with the name
-ordered a -> z from the latter, save
- open the ods file w/ n++, one more search/replace to turn it back to xhtml.
I could've used sigil, but I don't know all its regex.
The purpose... well the main purpose is learning
Anyway it is a book of quotations, so it's good to have them sorted alphabetically. All these links point to short quotations, not chapters or whatever.
Thank you once again, this website is awesome