וַיְהִ֖י כְּשָׁמְעָ֣ם אֶת־הַתּוֹרָ֑ה וַיַּבְדִּ֥ילוּ כָל־עֵ֖רֶב מִיִּשְׂרָאֵֽל׃
And it came to pass, when they had heard the law, that they separated from Israel all the alien mixture.
Read Jewish philosophical commentary on Nehemiah 13:3: and classical philosophical sources.