No sign up strip cam - Email validating in c

I have to write a program to validate an email address. I wanted to work through everything individually, and I sort of understand what you were doing.not really.

email validating in c-77

I am trying to learn from it, but I am still confused.

As it is, the code so far doesn't even come close to properly validating an email address.

The problem is so complex, actually, that the complete, industry-standard, regex for it is actually broken.

The Is Valid Email function checks for a valid email, Is Valid Email returns True if the email address is a valid email, Is Valid Email returns false if the email address isn’t proper syntax. '******************************************************* '* MYCPLUS Sample Code - '* * '* This code is made available as a service to our * '* visitors and is provided strictly for the * '* purpose of illustration.

The code is well commented and should explain what is happening . * '* * '* Please direct all inquiries to saqib at * '******************************************************* Function Is Valid Email(email Address) ' Declare variables Dim Valid Email, email Parts, i Loop Counter, email Char, acceptable Chars Valid Email = True 'set the default result to True 'acceptable Chars are the characters that we will allow in our email acceptable Chars="[email protected]" 'use the Split function to create an array with the @ as the separator 'so if your email was [email protected] email would be split into an array 'with the first array element holding "test" and the second "" email Parts = Split(email Address, "@") 'check to make sure that there is only 1 @ and that there are 2 parts 'remember arrays are zero based ' Using the UBound function will return the highest element in the array ' So if it's a valid email the UBound function will return 1, i.e.

if a user have entered # or $ sign in his/her email address then this function will return false.

0 start If UBound(email Parts) 0 Then Valid Email = false End If End If 'loop through each character of email For i Loop Counter = 1 to Len(email Address) ' Use Lcase & Mid functions, Mid function used to return each individual character 'in the email, and then Lcase converts it into lowercase email Char = Lcase(Mid(email Address, i Loop Counter, 1)) ' Check if the email Address characters are acceptable If In Str(acceptable Chars, email Char) = 0 and Not Is Numeric(email Char) Then Valid Email = false End if Next 'check if there is 2 .

An email address is a string of a subset of ASCII characters separated into two parts by an @ symbol . Is Match Method (String, String) - indicates whether the specified regular expression finds a match in the specified input string. Is Match("[email protected]", pattern)) { Message Box. Show ("Valid Email address "); } else { Message Box.

The part before the @ sign is the local part of the address, and the part after the @ sign is a domain name to which the email message will be sent . The pattern parameter consists of various regular expression language elements that symbolically describe the string to match pattern .

Tags: , ,