Email-address validation

  • Thread starter Thread starter Mika M
  • Start date Start date
M

Mika M

Simple question: Does Framework (1.1) contain any routine to check entered
email-address is valid ?

It's quite easy to make own code for that purpose, but why to do if
Framework (1.1) contain this kind of routine.
 
Hi,
You can use regular expressions for that. Check out the
System.Text.RegularExpressions namespace in the FCL. You can get regular
expressions for various pattern and format validations from many web sites.
One such site is http://www.regexlib.com/

HTH

Simple question: Does Framework (1.1) contain any routine to check entered
email-address is valid ?

It's quite easy to make own code for that purpose, but why to do if
Framework (1.1) contain this kind of routine.
 
Dim regValidEmail As New
System.Text.RegularExpressions.Regex("^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$")

If Not regValidEmail.IsMatch(VariableChecked) Then
MsgBox("That is incorrect. The Packers will win the super
bowl.")
End If
 
| > It's quite easy to make own code for that purpose
|
| Are you sure?!

don't be a smart-ass herf! is it quite easy to validate email addresses no
matter what rfc you design your code after...and, 822 is the simplest. you
could have at least chosen a harder one to support your smugness.

why are you an "mvp"?
 
steve said:
| > It's quite easy to make own code for that purpose
|
| Are you sure?!

don't be a smart-ass herf! is it quite easy to validate email addresses no
matter what rfc you design your code after...

Well, I would not consider writing the regular expression for RFC compliant
email address validation an "easy" job:

<URL:http://groups.google.de/groups?selm=evxfn5#[email protected]
hx.gbl>
and, 822 is the simplest. you could have at least chosen a harder
one to support your smugness.

?!?
 
<in-line>


| Ok I would like to see your solution please.


^((?>[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+\x20*|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*"\x20*)*(?<angle><))?((?!\.)(?>\.?[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+)+|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*")@(((?!-)[a-zA-Z\d\-]+(?<!-)\.)+[a-zA-Z]{2,}|\[(((?(?<!\[)\.)(25[0-5]|2[0-4]\d|[01]?\d?\d)){4}|[a-zA-Z\d\-]*[a-zA-Z\d]:((?=[\x01-\x7f])[^\\\[\]]|\\[\x01-\x7f])+)\])(?(angle)>)$

not mine but one i have decided to use b/c it supports a more current email
rfc than the one i had made.
 
<in-line>


| Well, I would not consider writing the regular expression for RFC
compliant
| email address validation an "easy" job:

then you don't know regular expressions nor the rfc.

|
<URL:http://groups.google.de/groups?selm=evxfn5#[email protected]
| hx.gbl>

anyone who claims absolution of solution should only be considered wrong!
"This is the one and only RFC-822-compliant regex" that's a moronic
statement! as is the regular expression provided in that url.

| > and, 822 is the simplest. you could have at least chosen a harder
| > one to support your smugness.
|
| ?!?

2846 for example herf! apparently neither the email address rfc's nor
regular expressions are your strong-suit. were you not aware that there was
more than one rfc?
 
<in-line>


| Why aren't you an MVP?

i actually work for a living. ;^)

| Why are you dumping on Herfried?

herf *never* demonstrates a command for the language he is "mvp-ing". his
retort relies on posting url's to other people's bodies of work...and those
url's rarely directly answer anyone's questions. and just as rarely, his own
code actually does apply, is efficient, and works!

i guess his original reply finally pushed me to say something.
 
steve said:
<in-line>


| Why aren't you an MVP?

i actually work for a living. ;^)

Please post a link(s) pointing to articles you have written, code
samples put together, what you have given back to the community. I am
interested because I have not seen references to your work before as I
have the regulars here and it appears you are quite knowledgeable.

I understand what you are saying about "working for a living". I do too.
I wish I had more time to contribute, help and even more time to learn.
Because it is all to rare now that I have the time to learn new things.
Deadlines, Deadlines, Deadlines.......
 
steve said:
| Well, I would not consider writing the regular expression for RFC
compliant
| email address validation an "easy" job:

then you don't know regular expressions nor the rfc.

*PLONK*
 
| *PLONK*

"plonk"...now that's funny! i've been plonking you for years. it's just that
sometimes i find that i can't contain myself in response to some of your
usual brand of stupidity. your response, in typical herf fashion, to this
op's question being a prime example. ignore me all you want. it really
doesn't matter as i would throw out any response you would offer to a
question of mine as simply not viable or not applicable.

"plonk"...that is funny!
 
| Please post a link(s) pointing to articles you have written, code
| samples put together, what you have given back to the community. I am
| interested because I have not seen references to your work before as I
| have the regulars here and it appears you are quite knowledgeable.

wish i had the time to write articles and publish (for reading) code. i
don't. my contributions to community are offered in programming, teaching
programming, and hiring people with interests therein and helping them along
with their careers...including hiring some of them. if you're testing the
waters to find somthing of mine to pick apart, i'll not be providing such
opportunities. however, i'm still learning the "new-to-me" nuances of a
truly more oop language. at the same time though, i am very good at what i
do...i simply don't know everything...yet.

most importantly, i don't address posts here that i don't feel i can help in
providing an answer that works. as far as herf goes, he's been an mvp here
since this group's inception. i ask you to simply compare his responses to
say, harlow's (mvp too), or even cor (not mvp). this comparison should lead
you to ask the question, "why is herf an mvp?"

anyway, that's enough of this. you jumped in to defend someone and that's
fine. just know that it's my issue and no one elses. herf just get's called
on it every once in a while when i can't stand it any longer.

cheers.
 
i
don't. my contributions to community are offered in programming, teaching

programming, and hiring people with interests therein and helping them
along
with their careers...including hiring some of them.

Hey now you got my attention!! What postitions are you hiring for? :) If
you need contract work I am all ears....

if you're testing the
waters to find somthing of mine to pick apart, i'll not be providing such

opportunities.

Why would I want to pick you apart? I am seeking information about what
it is you do, your skill level and such. There are times when I look for
help and it is nice to know who the experts are in the various related
fields.

however, i'm still learning the "new-to-me" nuances of a
truly more oop language. at the same time though, i am very good at what i

do...i simply don't know everything...yet.

Nobody knows everything. Ken Tucker rules when it comes to datagrids, I
am good at Office automation, Jay is the guy when it comes to Outlook,
Bill Ryan does just about everything but he learns as well. The point is
that is how we get better is by learning from each other. Especially
when it comes to .NET when schools and such have been very slow to adopt
teaching it.
most importantly, i don't address posts here that i don't feel i can help
in
providing an answer that works.

Point taken. Sometimes though an answer that gets a person started is
just as helpful. I know what you mean though. Sometimes people post
answers that are not all that helpful.

as far as herf goes, he's been an mvp here
since this group's inception. i ask you to simply compare his responses to

say, harlow's (mvp too), or even cor (not mvp). this comparison should
lead
you to ask the question, "why is herf an mvp?"

My interest in this thread has gone beyond Herf but is more interested
in knowing what you do and what your specialities are. No harm intended
to you. The fact you took on Herfried is pretty gutsy as everyone I have
ever known in this group has for the most part thought of Herfried as a
genius. Of course he is 16 or maybe 18 now and working at a University
so they may not be too far off. Of course when I was 16-18 I was a bit
anyway, that's enough of this. you jumped in to defend someone and that's

fine. just know that it's my issue and no one elses. herf just get's
called
on it every once in a while when i can't stand it any longer.

cheers.


You too. Hope you keep hanging around so the rest of us can benefit from
your knowledge and maybe you will learn things too.
 
| Hey now you got my attention!! What postitions are you hiring for? :) If
| you need contract work I am all ears....

we are thinking about hiring another vb.net guy to help me out...there's a
lot of stuff to do. i would not be your hiring manager for this position but
would be your project manager. the company is "progress rail services" based
in alabama. as i live in texas, they obviously don't have hang-ups about
working remotely as long as you maintain their trust in managing your time.
it provides various services to railroads like bnsf, ttx, etc.

the current project involves standard and compact .net framework development
for collecting/validating/synchronizing data from out in the field on up to
a central server. i don't know you or i would get you on fairly
quickly...for now, i'd just get in contact with the it department via
http://www.progressrail.com .

| Why would I want to pick you apart? I am seeking information about what
| it is you do, your skill level and such. There are times when I look for
| help and it is nice to know who the experts are in the various related
| fields.

most logical assumption. when defending a kettle, it is often best to start
by showing the pot its own color.

| Point taken. Sometimes though an answer that gets a person started is
| just as helpful. I know what you mean though. Sometimes people post
| answers that are not all that helpful.

true, but this is herf's modus apparandai.

| My interest in this thread has gone beyond Herf but is more interested
| in knowing what you do and what your specialities are. No harm intended
| to you. The fact you took on Herfried is pretty gutsy as everyone I have
| ever known in this group has for the most part thought of Herfried as a
| genius. Of course he is 16 or maybe 18 now and working at a University
| so they may not be too far off. Of course when I was 16-18 I was a bit

i do whatever needs to be accomplished and have thus far gone nearly run the
gammut. not gutsy...just not naive nor unexperienced...herf is no genius and
i've seen no supportive information to the contrary. and, there are plenty
of other who share my sentiments on that issue...we just speak out on rare
occasions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top