Verifying email address with corona sdk

In my project, a form is for the user to fill out the details. In this case, a single text field enters the email id of the user. So I need to check the email in this text box, in the crown project

+3
source share
3 answers

Try this regex:

local email = "email@email.com"
if (email:match("[A-Za-z0-9%.%%%+%-]+@[A-Za-z0-9%.%%%+%-]+%.%w%w%w?%w?")) then
    print("VALID EMAIL")
else
    print("INVALID EMAIL")                
end
+10
source

Use the regex pattern to validate email.

Use this parameter "[A-Za-z0-9%. %%% +% -] + @ [A-Za-z0-9%. %%% +% -] +%.% W% w% weight? % weight?"

0
source

:

local pattern = "[% w] [% p] [@] [% w] + [.] [% w.] + [^.] +"

the return value is ~ = nil and #value> = 1 and #value <= 63 and istring.is_ascii (value), not the value: match (pattern) and #value: match (pattern) == #value

Ex: email@email.com   email@email.com.br

0
source

All Articles