On Sat, Mar 9, 2024 at 7:52 PM yary wrote:
> how to sort by alpha & numeric segments (b3b, a1a, c20c) => (a1a, b3b, c2c)
Ahhh. D'oh. Thanks! 💚
Now I see what was required, or at least think I do:
.sort: {m:g/ \d+{make +$/} | \D+{make ~$/} /».made}
That does what was meant, right?
--
love, r
Using my quick-intuition, are these methods sorting on the earliest number
withing the string, ignoring the non-digits?
$ raku -e '.say for .sort: {m/ \d+ /.Int}'
$ raku -e '.say for .sort: +*.match: / \d+ /'
let's see
$ raku -e '.say for .sort: {m/ \d+ /.Int}'
it1
does2
not3
matter10
what20
the