Sort lists by last name

I want to create a composersort field that sorts by composer's last name.
The information is in the composer field and I want to transpose first and last names and copy them to the composersort field. In other words,

field composer --- James Joyce
field composer sort -- Joyce, James

The post below is sort of the reverse of what I want to do, but I don't know enough about the expressions to adapt it to my need.
Editing Composers

Many thanks.

create an action of the type "Replace with regular expression" for the field composersort.
Enter as Search String: (.) (.)
Enter as Replace String: $2, $1

Works only for names that really only are composed of a first and a last name and not several first names.

Read there ...
Composersort mit mehreren Personen
Composersort mit mehreren Personen