On 2020-05-24 15:51, Patrick R. Michaud wrote:
On Mon, May 25, 2020 at 12:07:22AM +0200, Tobias Boege wrote:
   @things.sort: {
       .comb(/ \d+ | \D+ /)
       .map({ .Int // .self })
   }


Or how about even somethig like

    @things.sort: *.Version;

which does handle a reasonable set of version semantics...?

(The .Version method was apparently added in 2020.01.)

Pm



my @things = <a5 a2 b123 a133 a1 a22>.sort: *.Version; dd @things; for @things {say $_;}
   Array @things = ["a1", "a2", "a5", "a22", "a133", "b123"]
   a1
   a2
   a5
   a22
   a133
   b123


I like it!

Reply via email to