in reply to Re^2: Find Length Of Longest Ascending/Descending Sequence
in thread Find Length Of Longest Ascending/Descending Sequence

Notice the repetition:
<*0123456789> ** <?after 9>

is short for

<*0123456789> [ <?after 9> <*0123456789>]*

So if it matches the first one, and upto 9 (that's what the <?after 9> checks), it tries again to start with 0.

To extract the longest match, you need to collect all, and overlapping (because the last digits of an ascending sequence can be the first of a descending sequence):

my regex seq { ... } my $length = [max] $teststring.match(&seq, :g, :overlap)>>.chars;