I posted an answer here.
You must have 11.5.1 beta or higher installed to use the script.
Save the code as a .js file into the script addin folder.
Enable the script, then rightclick on the column headers, then select Columns->Script->Col1, Col2, and Col3.
Now you can sort based on the part you want the usual method clicking the respective column.