puts readlines.sort_by {|s| s[/\d+$/].to_i}
a b c 44 x y 33 z 22 11
11 z 22 x y 33 a b c 44
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!