Does anyone have any VB.NET functions which validate an email address?
Could you post it? I would like it to do as much as the regular expression
validator if possible.
Thanks in advance! 8 1477
there should already be a email validator regex function in the validators
to test for this (at least there is in asp.net) but here you go...
\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
regex function to validate all email addresses
"VB Programmer" <Do*****************@jEmail.com> wrote in message
news:uu**************@TK2MSFTNGP09.phx.gbl... Does anyone have any VB.NET functions which validate an email address? Could you post it? I would like it to do as much as the regular expression validator if possible.
Thanks in advance!
Thanks, but I'm looking for a VB.NET version. Do you know of one?
"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:ex*************@TK2MSFTNGP11.phx.gbl... there should already be a email validator regex function in the validators to test for this (at least there is in asp.net) but here you go...
\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
regex function to validate all email addresses
"VB Programmer" <Do*****************@jEmail.com> wrote in message news:uu**************@TK2MSFTNGP09.phx.gbl... Does anyone have any VB.NET functions which validate an email address? Could you post it? I would like it to do as much as the regular expression validator if possible.
Thanks in advance!
Oh... I got it! Here's one I'd like to share. If anyone has any better one
please let me know.
Private Function EmailIsValid(ByVal strEmailAddress As String) As
Boolean
Return Regex.IsMatch(strEmailAddress,
"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9
\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$")
End Function
Thanks!
"VB Programmer" <Do*****************@jEmail.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl... Thanks, but I'm looking for a VB.NET version. Do you know of one?
"Brian Henry" <br**********@newsgroups.nospam> wrote in message news:ex*************@TK2MSFTNGP11.phx.gbl... there should already be a email validator regex function in the
validators to test for this (at least there is in asp.net) but here you go...
\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
regex function to validate all email addresses
"VB Programmer" <Do*****************@jEmail.com> wrote in message news:uu**************@TK2MSFTNGP09.phx.gbl... Does anyone have any VB.NET functions which validate an email address? Could you post it? I would like it to do as much as the regular expression validator if possible.
Thanks in advance!
VB Programmer wrote: Oh... I got it! Here's one I'd like to share. If anyone has any better one please let me know.
Private Function EmailIsValid(ByVal strEmailAddress As String) As Boolean Return Regex.IsMatch(strEmailAddress,
"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9 \-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$") End Function
Unfortunately, this code will refuse mails from the "museum" domain.
Replace the {2,4} with {2,6} to allow for this domain as well.
--
Jos
Thanks! Great catch!
"Jos" <jo***************@fastmail.fm> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... VB Programmer wrote: Oh... I got it! Here's one I'd like to share. If anyone has any better one please let me know.
Private Function EmailIsValid(ByVal strEmailAddress As String) As Boolean Return Regex.IsMatch(strEmailAddress,
"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9 \-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$") End Function
Unfortunately, this code will refuse mails from the "museum" domain.
Replace the {2,4} with {2,6} to allow for this domain as well.
--
Jos
In addition to the other comments:
MSDN has a handful of common Regular Expressions
patterns.
Here is the e-mail example: http://msdn.microsoft.com/library/de...mailformat.asp
The same section has a number of other examples.
I also find these pages to be useful when dealing with Regular Expressions: http://www.regular-expressions.info/ http://msdn.microsoft.com/library/de...geElements.asp
Hope this helps
Jay
"VB Programmer" <Do*****************@jEmail.com> wrote in message
news:uu**************@TK2MSFTNGP09.phx.gbl... Does anyone have any VB.NET functions which validate an email address? Could you post it? I would like it to do as much as the regular expression validator if possible.
Thanks in advance!
I don't get anything of what is happening in the function!!! How does this
validate Email addresses and why not the museum domain??
Confused & (probably) stupid.
"VB Programmer" <Do*****************@jEmail.com> wrote in message
news:ev**************@TK2MSFTNGP11.phx.gbl... Thanks! Great catch!
"Jos" <jo***************@fastmail.fm> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... VB Programmer wrote: Oh... I got it! Here's one I'd like to share. If anyone has any better one please let me know.
Private Function EmailIsValid(ByVal strEmailAddress As String) As Boolean Return Regex.IsMatch(strEmailAddress,
"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9 \-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$") End Function
Unfortunately, this code will refuse mails from the "museum" domain.
Replace the {2,4} with {2,6} to allow for this domain as well.
--
Jos
Never mind, just saw Jay's post.
"Vince" <sd***@fsd.com> wrote in message
news:ul*************@tk2msftngp13.phx.gbl... I don't get anything of what is happening in the function!!! How does this validate Email addresses and why not the museum domain?? Confused & (probably) stupid.
"VB Programmer" <Do*****************@jEmail.com> wrote in message news:ev**************@TK2MSFTNGP11.phx.gbl... Thanks! Great catch!
"Jos" <jo***************@fastmail.fm> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... VB Programmer wrote: > Oh... I got it! Here's one I'd like to share. If anyone has any > better one please let me know. > > Private Function EmailIsValid(ByVal strEmailAddress As String)
As > Boolean > Return Regex.IsMatch(strEmailAddress, >
"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9 > \-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$") > End Function
Unfortunately, this code will refuse mails from the "museum" domain.
Replace the {2,4} with {2,6} to allow for this domain as well.
--
Jos
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Dynamo |
last post by:
Hi
The following script was taken from John Coggeshall's (PHP consultant) in his
article on Zends site at http://www.zend.com/zend/spotlight/ev12apr.php
// Get the email address to validate...
|
by: Stephen Poley |
last post by:
I have quite often (as have probably many of you) come across HTML forms
with irritating bits of Javascript attached. The last straw on this
particular camel's back was a large form I was asked to...
|
by: Steve |
last post by:
Hi
I have a really weird problem and any assistance would be welcome.
I have developed an app in Access 2002. The app runs perfectly on the
development machine. I have packaged the app
using...
|
by: TIBM |
last post by:
Hi. I've posted this question on another newsgroup, but I haven't received any answers..
I have a login page where users input userID and password and click a Login button. Before calling the ...
|
by: VB Programmer |
last post by:
Does anyone have any VB.NET functions which validate an email address?
Could you post it? I would like it to do as much as the regular expression
validator if possible.
Thanks in advance!
|
by: Rik |
last post by:
Hello guys,
now that I'm that I'm working on my first major 'open' forms (with
uncontrolled users I mean, not a secure backend-interface), I'd like to add
a lot of possibilities to check wether...
|
by: e_matthes |
last post by:
Hello everyone,
I've read enough about email validation to know that the only real
validation is having a user respond to a confirmation message you've
sent them. However, I want to store the...
|
by: JvC |
last post by:
Does anyone have a good routine for EMail address validation? The one
that I use is fairly primitive, and I need to beef it up. I have
downloaded several from the web, and they all get screwed up...
|
by: Bryan |
last post by:
I want my business objects to be able to do this:
class Person(base):
def __init__(self):
self.name = None
@base.validator
def validate_name(self):
if not self.name: return
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |