[mcs] recursive pattern matching