Why isn’t my rewrite rule for add_rewrite_rule not working as expected?

so the problem with the colon is that it has no special meaning so your regex is looking to match :/ literally – that would work for a string with a structure like:

/madagascar/subpage:/2

you would get a full match and 4 groups:

array 
(
    [0] => 'madagascar/subpage:/2'
    [1] => 'madagascar'
    [2] => 'subpage'
    [3] => ':/2'
    [4] => '2'
)

but since the colon is not in your tested string, all you get is a full match and two groups (only parts (madagascar|uganda)and (.?.+?)? tested positive)

array
(
    [0] => 'madagascar/subpage/2'
    [1] => 'madagascar'
    [2] => 'subpage/2'
)