Let\'s say I have an unsorted array from 1 to 10, as shown below...
a = ["3", "5", "8", "4", "1", "2",
Another option, that can be used in your example or others arrays like
a = ["teste", "test", "teste2", "tes3te", "10teste"]
is:
a.sort_by! {|s| s[/\d+/].to_i}