May 18, 2020 Replies: 3 B4X: Copy Private Sub EmailAddressCheck(email As String) As Boolean Return Regex.IsMatch("^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$",email) End Sub Code: Copy If EmailAddressCheck("[email protected]") = True Then Log("E-Mail is valid") Else Log("E-Mail is not valid") End If Click to expand...
B4X: Copy Private Sub EmailAddressCheck(email As String) As Boolean Return Regex.IsMatch("^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$",email) End Sub Code: Copy If EmailAddressCheck("[email protected]") = True Then Log("E-Mail is valid") Else Log("E-Mail is not valid") End If
aeric Expert Licensed User Longtime User May 24, 2020 #2 B4X: Copy If Regex.IsMatch(".+@.+\..+", req.GetParameter("email")) = False Then resp.SendError(500, "Invalid email address.") End If I found this code inside FormExampleHelper class in ServerHelloWorld.zip.
B4X: Copy If Regex.IsMatch(".+@.+\..+", req.GetParameter("email")) = False Then resp.SendError(500, "Invalid email address.") End If I found this code inside FormExampleHelper class in ServerHelloWorld.zip.
toby Well-Known Member Licensed User Longtime User May 29, 2020 #3 aeric said: B4X: Copy If Regex.IsMatch(".+@.+\..+", req.GetParameter("email")) = False Then resp.SendError(500, "Invalid email address.") End If I found this code inside FormExampleHelper class in ServerHelloWorld.zip. Click to expand... It's for B4J only; correct me if I'm wrong.
aeric said: B4X: Copy If Regex.IsMatch(".+@.+\..+", req.GetParameter("email")) = False Then resp.SendError(500, "Invalid email address.") End If I found this code inside FormExampleHelper class in ServerHelloWorld.zip. Click to expand... It's for B4J only; correct me if I'm wrong.
Alexander Stolte Expert Licensed User Longtime User May 29, 2020 #4 toby said: It's for B4J only; correct me if I'm wrong. Click to expand... No. B4X: Copy If Regex.IsMatch(".+@.+\..+", req.GetParameter("email")) = False Then Log("Invalid email address.") End If
toby said: It's for B4J only; correct me if I'm wrong. Click to expand... No. B4X: Copy If Regex.IsMatch(".+@.+\..+", req.GetParameter("email")) = False Then Log("Invalid email address.") End If