Shape Train Pattern Match