If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
E-mail address validation
Is there a way to set up a field where there's validation that the format is
a valid email address? For example, I have any number of characters before the @ symbol then any number of characters before the . symbol then three characters. Does that make sense? Any help would be really great! Thanks in advance. Tracy |
#2
|
|||
|
|||
E-mail address validation
On Mon, 7 Sep 2009 20:57:01 -0700, TBell506
wrote: Is there a way to set up a field where there's validation that the format is a valid email address? For example, I have any number of characters before the @ symbol then any number of characters before the . symbol then three characters. Does that make sense? Any help would be really great! Thanks in advance. Tracy What makes you think that's the only valid email addresses possible? would be a perfectly valid address. So would This isn't a trivial problem at all! -- John W. Vinson [MVP] |
#3
|
|||
|
|||
E-mail address validation
Simplest approach would be to open your table in design view, and add a
validation rule on the field. Something like this: Is Null OR ((Like "*?@?*.?*") AND (Not Like "*[ ,;]*")) where you put the invalid characters inside the square brackets. For an explanation of validation rules, see: http://allenbrowne.com/ValidationRule.html -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "TBell506" wrote in message ... Is there a way to set up a field where there's validation that the format is a valid email address? For example, I have any number of characters before the @ symbol then any number of characters before the . symbol then three characters. Does that make sense? Any help would be really great! Thanks in advance. Tracy |
#4
|
|||
|
|||
E-mail address validation
=?Utf-8?B?VEJlbGw1MDY=?= wrote
in : Is there a way to set up a field where there's validation that the format is a valid email address? For example, I have any number of characters before the @ symbol then any number of characters before the . symbol then three characters. Does that make sense? Any help would be really great! Thanks in advance. I've cribbed this Regular Expression from others. I use it in the email scripts on my web pages: ^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$ This informative, pragmatic and sensible article: http://www.regular-expressions.info/email.html ....considers the subject and the drawbacks of various approaches. It even offers the RegEx that is supposed to implement the exact RFC for valid email addresses. Here it is: (?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"( ?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b \x0c\x0e-\x7f])*")@(??:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]( ?:[a-z0-9-]*[a-z0-9])?|\[(??:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\ ..){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]?:[\ x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e -\x7f])+)\]) Wisely, that article recommends *not* using this RegEx. -- David W. Fenton http://www.dfenton.com/ usenet at dfenton dot com http://www.dfenton.com/DFA/ |
#5
|
|||
|
|||
E-mail address validation
On 8 Sep 2009 18:10:04 GMT, "David W. Fenton"
wrote: It even offers the RegEx that is supposed to implement the exact RFC for valid email addresses. Here it is: (?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"( ?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b \x0c\x0e-\x7f])*")@(??:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]( ?:[a-z0-9-]*[a-z0-9])?|\[(??:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\ .){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]?:[\ x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e -\x7f])+)\]) Wisely, that article recommends *not* using this RegEx. Thanks, David! As I said: not trivial! -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|