How do you only allow people to register if they have a certain email ending?

I want only people with the email ending of the school district im in to be able to register. so how would i restrict registration to only people with an email like 'whatever123@school.org'.