Questions tagged [email-validation]

Email validation is the process of deciding whether a given string is a valid email-address or not. This is distinct from email verification, which is necessary to determine if a given email address really exists, and (usually) whether a particular person has access to it (e.g. during an account signup process).

1243 questions
124
votes
5 answers

Regular expression which matches a pattern, or is an empty string

I have the following Regular Expression which matches an email address format: ^[\w\.\-]+@([\w\-]+\.)+[a-zA-Z]+$ This is used for validation with a form using JavaScript. However, this is an optional field. Therefore how can I change this regex to…
Curtis
  • 101,612
  • 66
  • 270
  • 352
92
votes
5 answers

What is a good regular expression for catching typos in an email address?

When users create an account on my site I want to make server validation for emails to not accept every input. I will send a confirmation, in a way to do a handshake validation. I am looking for something simple, not the best, but not too simple…
eKek0
  • 23,005
  • 25
  • 91
  • 119
91
votes
20 answers

HTML5 Email input pattern attribute

I’m trying to make a html5 form that contains one email input, one check box input, and one submit input. I'm trying to use the pattern attribute for the email input but I don't know what to place in this attribute. I do know that I'm supposed to…
Colton
  • 995
  • 1
  • 7
  • 10
89
votes
8 answers

How long can a TLD possibly be?

I'm working on an email validation regex in PHP and I need to know how long the TLD could possibly be and still be valid. I did a few searches but couldn't find much information on the topic. So how long can a TLD possibly be?
HellaMad
  • 5,294
  • 6
  • 31
  • 53
77
votes
11 answers

Check if a string is an email address in PHP

I am trying to do an SQL query, but I need to check somehow if the value is an email address. I need a way to check if $user is an email address, because I have user values such as this in my…
homework
  • 4,987
  • 11
  • 40
  • 50
76
votes
1 answer

Can there be an apostrophe in an email address?

Possible Duplicate: What characters are allowed in email address? I have an email address with an apostrophe in it and am wondering if that is valid?
mikenichols
  • 969
  • 2
  • 11
  • 19
69
votes
4 answers

What is the actual minimum length of an email address as defined by the IETF?

I'm specifically looking for the minimum length of the prefix and domain. I've seen conflicting information and nothing that looks authoritative. For reference, I found this page which claims that a one character email address is…
David Watson
  • 3,394
  • 2
  • 36
  • 51
49
votes
6 answers

How to validate an email address in Go

I have checked the StackOverflow and couldn't find any question that answers how to validate email in Go Language. After some research, I figured out and solved it as per my need. I have this regex and Go function, which work fine: import ( …
Riyaz Khan
  • 2,765
  • 2
  • 15
  • 29
46
votes
6 answers

Best Regular Expression for Email Validation in C#

I have seen a multitude of regular expressions for different programming languages that all purport to validate email addresses. I have seen many comments saying that the expressions in question do not work for certain cases and that they are…
Sachin Kainth
  • 45,256
  • 81
  • 201
  • 304
45
votes
13 answers

Email validation on textField in iOS

In iOS App, how to add Email validation on UITextField?
ios
  • 6,134
  • 20
  • 71
  • 103
40
votes
10 answers

Angular2 email validation

I am new in learning Angular2, and I want to make a validation form that verifies emails after a RegEx pattern. My code looks something like this but I don't have any idea if I am doing it right, or what I did wrong, can somebody please help me a…
Sergiu
  • 415
  • 1
  • 4
  • 6
38
votes
6 answers

Check that email address is valid for System.Net.Mail.MailAddress

Currently, to avoid errors from being thrown up due to invalid email addresses, I do the following: Dim mailAddress As MailAddress Try mailAddress = New MailAddress("testing@invalid@email.com") Catch ex As Exception 'Invalid email End…
Curtis
  • 101,612
  • 66
  • 270
  • 352
34
votes
5 answers

Email validation using regular expression in JSF 2 / PrimeFaces

I have an input field taking an email address: How can I validate the entered value as a valid email address using regex in JSF 2 / PrimeFaces?
Nidheesh
  • 4,390
  • 29
  • 87
  • 150
34
votes
4 answers

List of mock valid/invalid Email Addresses for Unit Tests

Does anyone know of a list of email addresses (which don’t need to be real) I can use for an email validation assembly for a unit test? I’ve been looking for such a list and can’t seem to find one. I’m not looking for real addresses, just ones that…
34
votes
3 answers

Email confirmation in Rails without using any existing authentication gems/plugins

I'm working on this alerting service in Rails. And really, all I need to do is, when a user signs up, send a confirmation email to the user. And upon confirmation from the user, activate the user. I tried playing around with Matt Hooks' Authlogic…
Shreyas
  • 8,737
  • 7
  • 44
  • 56
1
2
3
82 83