Unbreak smartmatching m:g// and s:g///.

Behavior of m:g// and s:g/// should now rather closely
match S05, section "Capturing from repeated matches"
and the last two paragraphs of the section "Substitution".