+ All Categories
Home > Technology > Email Validation

Email Validation

Date post: 24-May-2015
Category:
Upload: hashim-lokasher
View: 149 times
Download: 2 times
Share this document with a friend
Popular Tags:
23
Hashim Naseer Lokasher 11014119-129 Muazzam Ali Sundhu 11014119-099 Haseeb Mehmood 11014119-089 Gohar Naseer 11014119-087 Muhammad Qasim Ali 11014119-128 THEORY OF AUTOMATA PROJECT TITLE: EMAIL VALIDATOR
Transcript
Page 1: Email Validation

Hashim Naseer Lokasher 11014119-129

Muazzam Ali Sundhu 11014119-099Haseeb Mehmood 11014119-089

Gohar Naseer 11014119-087Muhammad Qasim Ali 11014119-128

THEORY OF AUTOMATA

PROJECT TITLE: EMAIL VALIDATOR

Page 2: Email Validation

Introduction

Email Validator

Page 3: Email Validation

Email Validator

What does Validation means?

Page 4: Email Validation

Validation

Validation is the process of checking data against a standard or requirement.

The term is commonly used when:Checking the information entered by a person

when storing data, sending information or using an online service (FORM VALIDATION).

Page 5: Email Validation

Email Validation

So,

Email Validation means to validate and check an email address.

Page 6: Email Validation

Our Project

Is a email validator, whichValidates an Email AddressCheck the grammar and syntaxCan be used in Data Entry forms and Applications

Page 7: Email Validation

Screenshot

C# Programming Language is used for the development of this application.

WinForm and Regular Expressions class is also used

Page 8: Email Validation

Program Working

Email Validator

Page 9: Email Validation

So, What is a Valid Email Address?

Page 10: Email Validation

Valid Email Address

There's only one real answer to this:

A valid email address is one that you can send

emails to

Contemporary email addresses consist of a "local

part" separated from a "domain part" (a fully-

qualified domain name) by an at-sign ("@").

[email protected] is a valid Email Address

Page 11: Email Validation

Regular Expressions

 If you only want to check if an address is grammatically correct then you could use a regular expression

Using a regular expression that recognizes email addresses could be useful in various situations:

For example

to scan for email addresses in a document,

to validate user input,

or as an integrity constraint on a data repository.

Page 12: Email Validation

Regular Expressions

Regular expressions are a very cool feature for pattern recognition in strings.

Mathematically speaking regular expressions are parsed through a "finite state machine".

As the name implies, such a machine has only a finite number of states, and it has no external memory attached.

Page 13: Email Validation

Parsing

Parsing or syntactic analysis is the process of analysing a string of symbols, either in natural language or in computer languages, according to the rules of a formal grammar.

Page 14: Email Validation

Regular Expression Processor

A regular expression processor processes a regular expression statement expressed in terms of a grammar in a given formal language, and with that examines the target text string, parsing it to identify substrings that are members of its language, the regular expressions.

Page 15: Email Validation

"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$"

?

Page 16: Email Validation

"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$"

Regular Expression for Email Validation

[email protected] can be validated as

Myname @ mycompany com.

We compared the given email address with the upper RegEx to validate it is synthetically

correct or not.

Page 17: Email Validation

Regular Expressions

Any validation problems that involve recursion, option, limitation is easier to solve with regular expressions than using other ways (like if-else if-else, while condition)

Page 18: Email Validation

Regular Expressions

Regular Expressions can be used toTest if a string matches some pattern.

Scan for virus signatures.

Process natural language.

Search for information using Google.

Search for markers in human genome

Search-and-replace in a word processors.

Validate data-entry fields (dates, email, URL, credit card)

Page 19: Email Validation

Email Address Standards

There are acknowledged standards for what constitutes a valid email address.

These are defined in the Request For Comments documents (RFCs)

The syntax of email addresses has been defined in various RFCs, most notably RFC 822 and RFC 5322.

We used RFC 5322 , as this is the latest standard.

Page 20: Email Validation

Code Snippetstring pattern = @"^[a-z][a-z|0-9|]*([_][a-z|0-9]+)*([.][a-

z|" +

@"0-9]+([_][a-z|0-9]+)*)?@[a-z][a-z|0-

9|]*\.([a-z]" +

@"[a-z|0-9]*(\.[a-z][a-z|0-9]*)?)$";

System.Text.RegularExpressions.Match match =

Regex.Match(textBox1.Text.Trim(), pattern,

RegexOptions.IgnoreCase);

Page 21: Email Validation

Finite State Machine

Page 22: Email Validation

ANYQuestion?

Page 23: Email Validation

Thanks


Recommended