Email Validation

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
smith8867
Posts: 57
Joined: Tue Nov 18, 2014 5:36 pm

Email Validation

Post by smith8867 » Thu Jan 21, 2016 12:56 am

Is there anyway in LiveCode to validate an email that is entered into a field?

Thanks.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Email Validation

Post by Simon » Thu Jan 21, 2016 3:30 am

Here, I found this function somewhere a long time ago;

Code: Select all

function isEmail pWhat
   put matchtext(pWhat,"^[A-z0-9_\-\.]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]$") into tNotIP
   put matchtext(pWhat,"^(1*\d{1,2}|2[0-4]\d|25[0-5])\.(1*\d{1,2}|2[0-4]\d|25[0-5])\.(1*\d{1,2}|2[04]\d|25[0-5])\.(1*\d{1,2}|2[0-4]\d|25[0-5])(:\d{1,5})*$") into tIsIP
   return (tIsIP or tNotIP)
end isEmail
Thank you to whoever wrote it :)

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply