Sorting a list alphabetic then numeric

Using function proposed by @LostKobrakai:

def sort(list), do: Enum.sort_by(list, &comparator/2)

defp comparator(<<a, _::binary>> = ax, <<b, _::binary>> = bx) when a in ?0..?9 and b in ?0..9, do: ax <= bx
defp comparator(<<a, _::binary>>, _) when a in ?0..?9, do: true
defp comparator(ax, bx), do: ax <= bx

However it is not clear how "0a" should compare with "01". I assumed that only first character decides. Otherwise you need to expand comparator/2 function a little.

EDIT: Fixed snippet, the in operator was missing.