An Egyptian court has ordered the release of former prime minister, Ahmed Nazif, because of a limit on pretrial detention in a corruption case.