I'm trying to pin down what $string.match(/pat/) should be returning.

>From S05:

Under "Return values from match objects"
"A match always returns a Match object..."

>From S29:

Under the definition of Str.comb

Saying

    $string.comb(/pat/, $n)

is equivalent to

    $string.match(rx:global:x(0..$n):c/pat/)

[ ...and later... ]

"If there are captures in the pattern, a list of Match objects (one
per match) is returned instead of strings."

Which implies that $string.match(/pat/) should indeed return a List of
Str and $string.match(/pat_with_groups/) should return a List of
Match.

I expected the S29 definition when first approaching $string.match I
feel it is more intuitive than what happens with S05. Could someone
clarify what the behavior should be?

Best Regards,
-Chris Davaz

Reply via email to