Revert pattern order: longer patterns first