This is an important procedural question. Article 7 of the Egyptian Penal Code establishes the general rule that crimes are punished according to the law in force at the time the act was committed. This is the principle of non-retroactivity — a new law generally cannot make something criminal that was legal when you did it.
However, Article 7 includes a significant and favorable exception: if the law changes after the offense but before a final judgment is issued, and the new law is more lenient (i.e., better for the accused), then the more favorable law applies. This means that if Egypt amends its Penal Code to reduce penalties for a certain crime while your case is still ongoing, you could benefit from the reduced penalty.
For expats navigating the Egyptian legal system, this provision is practically relevant if your case spans a period during which legal reforms occur. Always instruct your Egyptian legal counsel to monitor any relevant legislative changes during the course of your proceedings, as they could materially affect the outcome of your case.
This is general legal information, not legal advice. For advice on your specific situation, consult a lawyer licensed in Egypt.