forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Validate Emails
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
DelWolf
Newbie


Joined: 16 Oct 2004
Posts: 4

PostPosted: Sat Oct 16, 2004 9:18 am    Post subject: Validate Emails Reply with quote

Hello everyone,

Can someone help me work this problem out?

I have a list of emails and i need to validate them.
I need to make sure they are valid, meaning they have an @ and the dot in the .com, etc.

I need to make sure that i can use the address.

so i would need it to say if i had an email like
someone@someplace,com
I want it to say something about the comma being before com and give me chance to change it.
Back to top
View user's profile Send private message
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Sat Oct 16, 2004 9:28 am    Post subject: Reply with quote

First of all: welcome to VDSWORLD! Hi

I think the script below be able to do what you need:
Code:

%%Input = "vic@pythago.nl"

option fieldsep, "@"
parse "%%Username;%%Domain", %%Input
option fieldsep, |

if @null(%%Domain)
   warn There's an "@" missing in the email address
elsif @zero(@pos(".", %%Domain))
   warn There is no dot in the domain name
else
   info Valid email
end


Good luck Wink

Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sat Oct 16, 2004 9:33 am    Post subject: Reply with quote

hi DelWolf and welcome to our forum,

to answer your question, use the @pos() function to see if a string such as "@" is present or not

if it is, a number bigger than 1 is returned, and if it isn't then a 0 is returned

for example (off the top of my head so i hope it is right)

Code:


if @greater(@pos(@chr(064),%%email_address),0)
   rem email address contains @
end

if @greater(@pos(.com,%%email_address),0)
   rem %%email address contains .com
end


hope this helps

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Sun Oct 17, 2004 11:35 pm    Post subject: Reply with quote

Should also check that the @ and the . isn't at the very beginning or end and that there is atleast two characters before @ and after, and after the .

Wink

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Tue Oct 19, 2004 12:06 am    Post subject: Reply with quote

Boredom:
Code:

%%email = "test@vdsworldtest.com"
gosub Validate
%%email = "t@vdsworldtest.c"
gosub Validate
%%email = "sfadgdag"
gosub Validate
exit
:Validate
  %%atpos = @POS("@",%%email)
  %%dotpos = @POS(".",%%email)
  if @NOT(@GREATER(%%atpos,0))
    WARN There is no @CHR(34)"@"@CHR(34) in the inputed address.
   exit
  end
  if @NOT(@GREATER(%%dotpos,0))
    WARN "There is no "." in the inputed address."
   exit
  end
  if @BOTH(@GREATER(%%atpos,2),@GREATER(%%dotpos,0))
    if @GREATER(@FSUB(@LEN(%%email),%%dotpos),2)
     INFO %%email is Valid.
   else
     WARN There is only one character after the @CHR(34)"."@CHR(34) in the inputed address.
   end
  else
    WARN There is only one character before the @CHR(34)"@"@CHR(34) in the inputed address.
  end
  exit

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Tue Oct 19, 2004 3:03 pm    Post subject: Reply with quote

The latest version of String.dll has a function @string(IsEmail, [input string])

Checks whether the input string holding an email address conforms to standards.
The function relies on RFC 3696 - Application Techniques for Checking and Transformation of Names for validation rules

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Wed Nov 24, 2004 11:52 pm    Post subject: Reply with quote

Many companies have their employees full name as the email addy like this bill.gates@microsoft.com

So you could check for two or more dots before the @ and you could greet the user after entering the email addy.

Also, many companies who have offices in different citys and countries often have subdomains in their email addresses like @cal.microsoft.com

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Thu Nov 25, 2004 12:02 am    Post subject: Reply with quote

Dr. Dread, your email verifyer in the string.dll is very good.
I've tried all thinkable workarounds and I can't fool it. I even tried with html codes. Very nice work on the dll m8 Smile

I tried this
Code:
%A = @string(Soundex, "Jan")
%B = @string(Soundex, "Jahn")
%C = @string(Soundex, "Jon")
%D = @string(Soundex, "John")
info Result is: %A %B %C %D
why does all return J500 ?
Jon and John are different, they are also different from Jan and Jahn when pronaunced in english.

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Thu Nov 25, 2004 1:50 pm    Post subject: Reply with quote

Hey GT

I'm glad you like the mail verifier.

As concerns Soundex, this is a good page for getting to know the workings of the algorithm:
http://www.creativyst.com/Doc/Articles/SoundEx1/SoundEx1.htm

Greetz
Dr. Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Thu Nov 25, 2004 1:52 pm    Post subject: Reply with quote

Thanks for the link Doc, I'll check that out Smile
_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Thu Nov 25, 2004 4:16 pm    Post subject: Reply with quote

Have fun Wink

BTW, if you´re interested in that type of string comparison, I've been experimenting with
Metaphone and Levenshtein distance. They will probably be included in one of the next versions of string.dll

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Thu Nov 25, 2004 4:27 pm    Post subject: Reply with quote

Cool, sounds great.
I'd be glad to assist in testing if you'd like.

Btw, I'm planning a sort of spell checker soon. That is why I'm interested in this Smile

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Fri Nov 26, 2004 12:48 am    Post subject: Reply with quote

Righto. Could make sense. I use Levenshtein for an online search engine - if a user query comes out empty,
suggestions can be made for alternative search terms being within a Levenshtein distance of 1 or 2 from
the original one.

I will let you know when I implement these functions.

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Fri Dec 03, 2004 7:23 am    Post subject: Reply with quote

I got the new functions going. It should be possible now to get not only Soundex but also Levenshtein distance,
Metaphone, Like percentage and Trigram.

If ya wanna check it out (won't release it until further tests have been done) PM me or mail me.

Greetz
Dr. Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Fri Dec 03, 2004 1:25 pm    Post subject: Reply with quote

PM sent Smile
_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group