Registration form - way to accept emails ending in .edu only?

Not sure if there is a way to programme the registration form so it only accepts email addresses ending in ‘edu’ or other university endings?

Thank you in advance!