Now that you can pay ICANN $250,000 and get your own ending, any filtering becomes moot, since unless you keep your software filtering bang up to date, there will always be new domain name endings your software claims are invalid but which are valid.
Also, what about domain name endings that don't use the English alphabet?
Basically don't bother, no seriously don't, my most used email address that I have ends with ".info" but there are still websites out there that claim thats an invalid ending for a domain name, why ? because no one has bothered to keep the software upto date in years.
Just let people type what they will, and then do a DNS lookup to see if its valid or not.