How should I validate an e-mail address?

后端 未结 30 1995
臣服心动
臣服心动 2020-11-22 08:25

What\'s a good technique for validating an e-mail address (e.g. from a user input field) in Android? org.apache.commons.validator.routines.EmailValidator doesn\'t seem to be

30条回答
  •  时光取名叫无心
    2020-11-22 09:03

    Can I STRONGLY recommend you don't try to 'validate' email addresses, you'll just get yourself into a lot of work for no good reason.

    Just make sure what is entered won't break your own code - e.g. no spaces or illegal characters which might cause an Exception.

    Anything else will just cause you a lot of work for minimal return...

提交回复
热议问题