[plt-scheme] Regexp partially matches alternate (unexpected)
This result is what I expect:
> (regexp-match #rx"(4)56|(.*)" "456")
("456" "4" #f)
But, why does this partially match the first alternative, returning the clustered subexpression?...
> (regexp-match #rx"(4)56|(.*)" "4ab")
("4ab" "4" "4ab")
I would have expected to get:
("4ab" #f "4ab")
Is there any way to achieve the latter? What I'm really matching against is something more like:
> (regexp-match #px"(?:(?:(\\d)(\\d)(\\d))|(.*))" "4ab")
("4ab" "4" #f #f "4ab")
and, in the event that there are not 3 digits, I would expect #f instead of the "4"?
--- nadeem