"And the LORD said unto Moses and Aaron, This is the statute of the Passover" (Exodus 12:43-45). There is a passage that states a general rule at the beginning and a particular at the end, and a particular at the beginning and a general rule at the end. "And you shall be unto Me a kingdom of priests and a holy nation" (Exodus 19:6) is a general rule; "These are the words which you shall speak unto the children of Israel" (ibid.) is a particular. "This is the statute of the Torah" is a general rule; "that they bring you a red heifer" is a particular. "This is the statute of the Passover" is a general rule; "No foreigner shall eat of it" is a particular. [When a verse states] a particular and then a general rule and then a particular again, you include in the general rule only what is like the particular.
Reading the General and the Particular in the Law of the Passover
Yalkut Shimoni on Torah 211:1
(שמות יב מג-מה) וַיֹּאמֶר ה' אֶל מֹשֶׁה (וְאֶל) וְאַהֲרֹן זֹאת חֻקַּת הַפָּסַח. יֵשׁ פָּרָשָׁה שֶׁהוּא כּוֹלֵל בִּתְחִלָּה וּפוֹרֵט בַּסּוֹף, פּוֹרֵט בִּתְחִלָּה וְכוֹלֵל בַּסּוֹף (שמות יט, ו) "וְאַתֶּם תִּהְיוּ לִי מַמְלֶכֶת כֹּהֲנִים וְגוֹי קָדוֹשׁ", פְּרָט (שם) "אֵלֶּה הַדְּבָרִים אֲשֶׁר תְּדַבֵּר אֶל בְּנֵי יִשְׂרָאֵל", כְּלָל, "זֹּאת חֻקַּת הַתּוֹרָה", כְּלָל, (שם) "וְיִקְחוּ אֵלֶיךָ פָרָה אֲדֻמָּה", פְּרָט זֹאת חֻקַּת הַפָּסַח, כְּלָל כָּל בֶּן נֵכָר לֹא יֹאכַל בּוֹ, פְּרָט (פְּרָט וּ)כְּלָל וּפְרָט אֵין בַּכְּלָל אֶלָּא מַה שֶׁבַּפְּרָט.