update all pattern match function