Skip to content Skip to sidebar Skip to footer

Android Email Validation For English And Arabic Characters

I am currently using this regular expression pattern to validate email addresses: android.util.Patterns.EMAIL_ADDRESS.matcher(emailAddress).matches(); It doesn't work with Arabic

Solution 1:

This may not be the best answer, but I was able to get it to work by adding the aribic characters:

[\u0621-\u064A\u0660-\u0669a-zA-Z0-9\+\.\_\%\-\+]{1,256}\@[\u0621-\u064A\u0660-\u0669a-zA-Z0-9][\u0621-\u064A\u0660-\u0669a-zA-Z0-9\-]{0,64}(\.[\u0621-\u064A\u0660-\u0669a-zA-Z0-9][\u0621-\u064A\u0660-\u0669a-zA-Z0-9\-]{0,25})+

Here's an example on regexr! (it doesn't display Arabic selection properly, but it is selected)

Post a Comment for "Android Email Validation For English And Arabic Characters"