Voici android.util.Patterns.EMAIL_ADDRESS
[a-zA-Z0-9 + ._ \% - +] {1 256} \ @ [a-zA-Z0-9] [a-zA-Z0-9 -] {0,64} (. [a- zA-Z0-9] [a-zA-Z0-9 -] {0,25}) +
String
correspondra si
Start by 1->256 character in (a-z, A-Z, 0-9, +, ., _, %, - , +)
then 1 '@' character
then 1 character in (a-z, A-Z, 0-9)
then 0->64 character in (a-z, A-Z, 0-9, -)
then **ONE OR MORE**
1 '.' character
then 1 character in (a-z, A-Z, 0-9)
then 0->25 character in (a-z, A-Z, 0-9, -)
Exemple d'e-mail de match spécial
a@b.c
a+@b-.c
a@b.c.d.e.f.g.h
Vous pouvez modifier ce modèle pour votre cas, puis valider en
fun isValidEmail(email: String): Boolean {
return Patterns.EMAIL_ADDRESS.matcher(email).matches()
}