anchor.diff:                    end;
                    (_, {false, _, _}) -> {false, Rest0, Acc0}
                 end, {true, Rest0, Acc0}, Children).
  +
  +match_either(#either{children=Children}, Rest0, Acc0) ->
  +  Outcomes = lists:foldl(fun(Pat, Acc) ->
  +                             case match(Pat, Rest0, Acc0) of
  +                               {true , _, _} = Res -> [Res|Acc];
  +                               {false, _, _}       -> Acc
  +                             end
  +                         end, [], Children),
  +  case lists:reverse(Outcomes) of
  +    []    -> {false, Rest0, Acc0};
  +    [H|T] ->
  +      {true, R, A} = lists:foldl(fun most_consumed/2, H, T),
  +      {true, R, lists:reverse(A)}
  +  end.
  +
  +most_consumed({_, R, _}=Res, {_, Min, _}) when length(R) < length(Min) -> Res;
  +most_consumed({_, _, _}    , Acc)                                      -> Acc.
   
   match_child_pattern(Pat, Rest0, Acc) ->
     case single_match(Pat, Rest0) of
  
positive.code:   , ?_assertEqual({false, [] , []} , match(req([A])   , []))
    , ?_assertEqual({false, [X], []} , match(req([A])   , [X]))
    , ?_assertEqual({false, [A], []} , match(req([A, X]), [A]))
    ].
  
  partition(Str, Delim) ->
  
negative.code: 
  match(#optional{}=Pat, Rest, Acc) -> match_optional(Pat, Rest, Acc);
  match(#required{}=Pat, Rest, Acc) -> match_required(Pat, Rest, Acc);
  match(#either{}  =Pat, Rest, Acc) -> match_either(Pat, Rest, Acc);
  match(Pat            , Rest, Acc) -> match_child_pattern(Pat, Rest, Acc).
  
  match_optional(#optional{children=Children}, Rest0, Acc0) ->
  