match patterns in the order reversed to the order they are registered,