Exception particles (أدوات الاستثناء) are used to exclude specific items from a general statement. The most common exception particle is إلّا (except), but Arabic also uses غير, سوى, عدا, خلا, and حاشا for similar purposes, each with its own grammatical requirements.
With إلّا, the grammar of the excepted noun (المستثنى) depends on the type of sentence. In a complete affirmative sentence (تام مثبت), the excepted noun is always منصوب: جاء الطلابُ إلّا زيدًا (all the students came except Zaid — زيدًا is accusative). In a complete negative sentence (تام منفي), you have a choice: the excepted noun can be منصوب or it can follow the case of the preceding noun (بدل).
In an incomplete negative sentence (ناقص منفي) — where the general group isn't mentioned — إلّا is essentially ignored grammatically, and the excepted noun takes whatever case the sentence requires: ما جاءَ إلّا زيدٌ (no one came except Zaid — زيدٌ is مرفوع because it's the فاعل). This type is very common in everyday Arabic and in the Quran.
غير and سوى function as nouns meaning "other than" and are declined according to their position in the sentence, while the noun following them is always مجرور (genitive) because of the إضافة construction: جاء الطلابُ غيرَ زيدٍ (the students came other than Zaid). The particles عدا, خلا, and حاشا can function either as verbs (putting the next noun in نصب) or as prepositions (putting the next noun in جر).
The topic of exception is considered intermediate to advanced in Arabic grammar, but it appears frequently in the Quran and classical texts. Ilm Al Lughah covers it thoroughly in the Nahw courses, with clear examples for each type and interactive quizzes to test your understanding of the different exception scenarios.