Email Validation

383 views
Skip to first unread message

clipper6

unread,
Dec 1, 2014, 8:24:41 PM12/1/14
to harbou...@googlegroups.com
Is there someone willing to share their email validation code or point me to a library or contrib. I don't want to make it from scratch.

Riztan Gutierrez

unread,
Dec 1, 2014, 9:39:06 PM12/1/14
to harbou...@googlegroups.com
Hi, I hope you can serve this function.

Function IsMail(cMail)
   Local lResp := .f.
   Local cRegExp

   cRegExp := "^[_a-z0-9-]+(\.[_a-z0-9-]+)"
   cRegExp += "*@[a-z0-9-]+(\.[a-z0-9-]+)*"
   cRegExp += "(\.[a-z]{2,3})$"

   lResp := hb_RegExMatch( cRegExp, cMail )
return lResp



2014-12-01 20:54 GMT-04:30 clipper6 <arl...@gmail.com>:
Is there someone willing to share their email validation code or point me to a library or contrib. I don't want to make it from scratch.

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--


Riztan Gutiérrez



clipper6

unread,
Dec 2, 2014, 1:09:56 AM12/2/14
to harbou...@googlegroups.com
Thanks a lot.

Qatan

unread,
Dec 2, 2014, 4:44:17 AM12/2/14
to harbou...@googlegroups.com
Hello,
 
It may be a question of what is a valid email anyway...
 
I personally prefer:
 
FUNCTION IsMail( cMail )
RETURN   LEN( hb_regex( '^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$', ALLTRIM( cMail ), .F. ) ) == 1
 
But other options are valid as well... depend on what you want to validate.
 
Qatan
 
 
Sent: Tuesday, December 02, 2014 3:39 AM
Subject: Re: [harbour-users] Email Validation
Hi, I hope you can serve this function.
 
Function IsMail(cMail)
   Local lResp := .f.
   Local cRegExp

   cRegExp := "^[_a-z0-9-]+(\.[_a-z0-9-]+)"
   cRegExp += "*@[a-z0-9-]+(\.[a-z0-9-]+)*"
   cRegExp += "(\.[a-z]{2,3})$"

   lResp := hb_RegExMatch( cRegExp, cMail )
return lResp


2014-12-01 20:54 GMT-04:30 clipper6 <arl...@gmail.com>:
Is there someone willing to share their email validation code or point me to a library or contrib. I don't want to make it from scratch.
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


 
--
 

Riztan Gutiérrez


 

Riztan Gutierrez

unread,
Dec 2, 2014, 11:08:29 PM12/2/14
to harbou...@googlegroups.com
Qatan, thank's!
Reply all
Reply to author
Forward
0 new messages