結果 : efficient pattern matching algorithm