473,405 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Validate Email Address Using Regular Expressions

HELLO
I am using the following MICROSOFT SUGGESTED (somewhere on msdn)
regular expression to validate email addresses however I understand
that the RFP allows for "+" symbols in the email address and this
method does not....

Does anyone have an explanation?
Function IsValidEmail(ByVal strIn As String) As Boolean
' Return true if strIn is in valid e-mail format.
Return Regex.IsMatch(strIn,
("^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"))
End Function
THANKS
RYAN
Nov 21 '05 #1
5 3078
Hi Ryan!

"Ryan" schrieb
I am using the following MICROSOFT SUGGESTED (somewhere on msdn)
regular expression to validate email addresses however I understand
that the RFP allows for "+" symbols in the email address and this
method does not....

Does anyone have an explanation?


A real RFC-822-compliant regex ist very big and complicated.

Have a look at this:
http://www.codeproject.com/csharp/RFC822Validator.asp

This is the one and only RFC-822-compliant regex:

[\040\t]*(?: \( [^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\
xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] *)*\))
[^\\\x80-\xff\
n\015()] *)*\)
[\040\t]* )*(?'mailbox'(?'localpart'(?:[^(\040)<>\@,;:\".\\\[\]\0
00-\037\x80-\xff]+(?![^(\040)<>\@,;:\".\\\[\]\000-\037\x80-\xff])|(?'quotedstr'\
"[^\\\x80-\xff\n\015"] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )*\"))
[\04
0\t]*(?: \( [^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\
n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] *)*\))
[^\\\x80-\xff\n\01
5()] *)*\) [\040\t]* )*(?:\. [\040\t]*(?: \( [^\\\x80-\xff\n\015()] *(?:(?:
\\
[^\x80-\xff] | \( [^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff]
[^\\\x80-\xff\n
\015()] *)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*
(?:[^(\040)<>\@,;:\".\\
\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\".\\\[\]\000-\037\x80-\xff])|(?'quote
dstr'\"[^\\\x80-\xff\n\015"] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"]
* )*\")
) [\040\t]*(?: \( [^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80
-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] *)*\))
[^\\\x80-\xf
f\n\015()] *)*\) [\040\t]* )*)*) \@ [\040\t]*(?: \( [^\\\x80-\xff\n\015()]
*(?:(
?: \\ [^\x80-\xff] | \( [^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff]
[^\\\x80
-\xff\n\015()] *)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*
(?'domain'(?:[^(
\040)<>\@,;:\".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\".\\\[\]\000-\037\x8
0-\xff])|\[(?: [^\\\x80-\xff\n\015\[\]"] | \\
^\x80-\xff] )*\])[\040\t]*(?: \
( [^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *
(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] *)*\)) [^\\\x80-\xff\n\015()]
*)*\)
[\040\t]* )*(:?\. [\040\t]*(?: \( [^\\\x80-\xff\n\015()] *(?:(?: \\
[^\x80-\xf
f] | \( [^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff]
[^\\\x80-\xff\n\015()] *)
*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*
(?:[^(\040)<>\@,;:\".\\\[\]\000-\
037\x80-\xff]+(?![^(\040)<>\@,;:\".\\\[\]\000-\037\x80-\xff])|\[(?:
[^\\\x80-\xf
f\n\015\[\]"] | \\ [^\x80-\xff] )*\])[\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(
?:(?: \\ [^\x80-\xff] | \( [^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff]
[^\\\
x80-\xff\n\015()] *)*\)) [^\\\x80-\xff\n\015()] *)*\)
[\040\t]* )*)*)|(?:[^(\040
)<>\@,;:\".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\".\\\[\]\000-\037\x80-\x
ff])|(?'quotedstr'\"[^\\\x80-\xff\n\015"] *(?: \\ [^\x80-\xff]
[^\\\x80-\xff\n\
015"] * )*\"))[^()<>\@,;:\".\\\[\]\x80-\xff\000-\010\012-\037](?:(?: \(
[^\\\x80
-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \( [^\\\x80-\xff\n\015()] *(?: \\
[^\
x80-\xff] [^\\\x80-\xff\n\015()] *)*\)) [^\\\x80-\xff\n\015()] *)*\) |
(?'quot
edstr'\"[^\\\x80-\xff\n\015"] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"]
* )*\"
) )[^()<>\@,;:\".\\\[\]\x80-\xff\000-\010\012-\037] *)* < [\040\t]*(?: \(
[^\\\x
80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \( [^\\\x80-\xff\n\015()] *(?:
\\ [
^\x80-\xff] [^\\\x80-\xff\n\015()] *)*\)) [^\\\x80-\xff\n\015()] *)*\)
[\040\t
]* )*(?: \@ [\040\t]*(?: \( [^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff]
| \
( [^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^
\\\x80-\xff\n\015()] *)*\) [\040\t]* )*
(?'domain'(?:[^(\040)<>\@,;:\".\\\[\]\00
0-\037\x80-\xff]+(?![^(\040)<>\@,;:\".\\\[\]\000-\037\x80-\xff])|\[(?:
[^\\\x80-
\xff\n\015\[\]"] | \\ [^\x80-\xff] )*\])[\040\t]*(?: \(
[^\\\x80-\xff\n\015()]
*(?:(?: \\ [^\x80-\xff] | \( [^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff]
[^
\\\x80-\xff\n\015()] *)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*(:?\.
[\040
\t]*(?: \( [^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n
\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] *)*\))
[^\\\x80-\xff\n\015
()] *)*\) [\040\t]* )*
(?:[^(\040)<>\@,;:\".\\\[\]\000-\037\x80-\xff]+(?![^(\040
)<>\@,;:\".\\\[\]\000-\037\x80-\xff])|\[(?: [^\\\x80-\xff\n\015\[\]"] | \\
[^\x
80-\xff] )*\])[\040\t]*(?: \( [^\\\x80-\xff\n\015()] *(?:(?: \\
[^\x80-\xff]
| \( [^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\))
[^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*)*)(?: , [\040\t]*(?: \(
[^\\\x80-\xff
\n\015()] *(?:(?: \\ [^\x80-\xff] | \( [^\\\x80-\xff\n\015()] *(?: \\
[^\x80-\
xff] [^\\\x80-\xff\n\015()] *)*\)) [^\\\x80-\xff\n\015()] *)*\)
[\040\t]* )* \
@ [\040\t]*(?: \( [^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80
-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] *)*\))
[^\\\x80-\xf
f\n\015()] *)*\) [\040\t]* )*
(?'domain'(?:[^(\040)<>\@,;:\".\\\[\]\000-\037\x80
-\xff]+(?![^(\040)<>\@,;:\".\\\[\]\000-\037\x80-\xff])|\[(?:
[^\\\x80-\xff\n\015
\[\]"] | \\ [^\x80-\xff] )*\])[\040\t]*(?: \( [^\\\x80-\xff\n\015()]
*(?:(?:
\\ [^\x80-\xff] | \( [^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff]
[^\\\x80-\xf
f\n\015()] *)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*(:?\.
[\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(
?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] *)*\)) [^\\\x80-\xff\n\015()]
*)*\)
[\040\t]* )*
(?:[^(\040)<>\@,;:\".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\"
..\\\[\]\000-\037\x80-\xff])|\[(?: [^\\\x80-\xff\n\015\[\]"] | \\
[^\x80-\xff]
)*\])[\040\t]*(?: \( [^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\
x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] *)*\))
[^\\\x80-
\xff\n\015()] *)*\) [\040\t]* )*)*))*:[\040\t]*(?: \( [^\\\x80-\xff\n\015()]
*(?
:(?: \\ [^\x80-\xff] | \( [^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff]
[^\\\x
80-\xff\n\015()] *)*\)) [^\\\x80-\xff\n\015()] *)*\)
[\040\t]* )* )?(?'localpart
'(?:[^(\040)<>\@,;:\".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\".\\\[\]\000-
\037\x80-\xff])|(?'quotedstr'\"[^\\\x80-\xff\n\015"] *(?: \\ [^\x80-\xff]
[^\\\
x80-\xff\n\015"] * )*\")) [\040\t]*(?: \( [^\\\x80-\xff\n\015()] *(?:(?: \\
[^\
x80-\xff] | \( [^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff]
[^\\\x80-\xff\n\01
5()] *)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*(?:\. [\040\t]*(?: \(
[^\\\
x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \( [^\\\x80-\xff\n\015()] *(?:
\\
[^\x80-\xff] [^\\\x80-\xff\n\015()] *)*\)) [^\\\x80-\xff\n\015()] *)*\)
[\040\
t]* )*
(?:[^(\040)<>\@,;:\".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\".\\\[\
]\000-\037\x80-\xff])|(?'quotedstr'\"[^\\\x80-\xff\n\015"] *(?: \\
[^\x80-\xff]
[^\\\x80-\xff\n\015"] * )*\")) [\040\t]*(?: \( [^\\\x80-\xff\n\015()]
*(?:(?:
\\ [^\x80-\xff] | \( [^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff]
[^\\\x80-\xf
f\n\015()] *)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*)*) \@
[\040\t]*(?: \
( [^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *
(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] *)*\)) [^\\\x80-\xff\n\015()]
*)*\)
[\040\t]* )*
(?'domain'(?:[^(\040)<>\@,;:\".\\\[\]\000-\037\x80-\xff]+(?![^(\04
0)<>\@,;:\".\\\[\]\000-\037\x80-\xff])|\[(?: [^\\\x80-\xff\n\015\[\]"] | \\
[^\
x80-\xff] )*\])[\040\t]*(?: \( [^\\\x80-\xff\n\015()] *(?:(?: \\
[^\x80-\xff]
| \( [^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)
) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*(:?\. [\040\t]*(?: \(
[^\\\x80-\xff\n
\015()] *(?:(?: \\ [^\x80-\xff] | \( [^\\\x80-\xff\n\015()] *(?: \\
[^\x80-\xf
f] [^\\\x80-\xff\n\015()] *)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*
(?:
[^(\040)<>\@,;:\".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\".\\\[\]\000-\037
\x80-\xff])|\[(?: [^\\\x80-\xff\n\015\[\]"] | \\
^\x80-\xff] )*\])[\040\t]*(?
: \( [^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()
] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] *)*\))
[^\\\x80-\xff\n\015()] *)
*\) [\040\t]* )*)*)>)

Cheers

Arne Janning
Nov 21 '05 #2
I have anothing post somewhere asking a similar question...

1) will this regular expression work for all languages?

2) should I use the full regular expression and why don't people use
the full regular expression?

3) will the full expression handle all cases? Should I be less strict
with my validation.... are there email systems that don't follow this
standard?
Nov 21 '05 #3
"Ryan" <ry***@ungerboeck.com> schrieb:
I have anothing post somewhere asking a similar question...

1) will this regular expression work for all languages?
What do you mean with "languages"? Programming languages or natural
languages? Yes, it will work with all natural languages, and all
programming languages that support the same regular expression syntax with
the same semantics put on the syntax.
2) should I use the full regular expression and why don't
people use the full regular expression?
'cause they never read the RFC.
3) will the full expression handle all cases? Should I be
less strict with my validation.... are there email systems
that don't follow this standard?


This regular expression will handle all cases, and all RFC-compliant mail
systems will follow this standard.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #4
Obviously I need to read the RFP... my language question was in
reference to my question to whether an email in Chinese would work;
sounds like it does.

I asked the second question wondering if people didnt use the full
expression because of the speed of the validation.

Thanks Herfried
Ryan

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message news:<##**************@tk2msftngp13.phx.gbl>...
"Ryan" <ry***@ungerboeck.com> schrieb:
I have anothing post somewhere asking a similar question...

1) will this regular expression work for all languages?


What do you mean with "languages"? Programming languages or natural
languages? Yes, it will work with all natural languages, and all
programming languages that support the same regular expression syntax with
the same semantics put on the syntax.
2) should I use the full regular expression and why don't
people use the full regular expression?


'cause they never read the RFC.
3) will the full expression handle all cases? Should I be
less strict with my validation.... are there email systems
that don't follow this standard?


This regular expression will handle all cases, and all RFC-compliant mail
systems will follow this standard.

Nov 21 '05 #5
I want to validate email addresses in iebms to the standard RFC 822 or
something like that. This regular expression was recommended and will
work… however for some reason it always returns false…

Besides making double quotes two double quotes, I didn't change the
expression. I did that so the string would work.

Any help?

Ryan

Public Function ValidateEmail(ByVal astrEmailAddress As String) As
Boolean

Return System.Text.RegularExpressions.Regex.IsMatch(astrE mailAddress,
("^[\040\t]*(?: \( [^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] |
\( [^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff]
[^\\\x80-\xff\n\015()] *)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]*
)*(?'mailbox'(?'localpart'(?:[^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff])|(?'quotedstr'\""[^\\\x80-\xff\n\015""]
*(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015""] * )*\"")) [\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*(?:\. [\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\[^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*
(?:[^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff])|(?'quotedstr'\""[^\\\x80-\xff\n\015""]
*(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015""] * )*\"")) [\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*)*) \@ [\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*
(?'domain'(?:[^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff])|\[(?:
[^\\\x80-\xff\n\015\[\]""] | \\ [^\x80-\xff] )*\])[\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*(:?\. [\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*
(?:[^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff])|\[(?:
[^\\\x80-\xff\n\015\[\]""] | \\ [^\x80-\xff] )*\])[\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]*
)*)*)|(?:[^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff])|(?'quotedstr'\""[^\\\x80-\xff\n\015""]
*(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015""] *
)*\""))[^()<>\@,;:\"".\\\[\]\x80-\xff\000-\010\012-\037](?:(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) |
(?'quotedstr'\""[^\\\x80-\xff\n\015""] *(?: \\ [^\x80-\xff]
[^\\\x80-\xff\n\015""] * )*\"")
)[^()<>\@,;:\"".\\\[\]\x80-\xff\000-\010\012-\037] *)* < [\040\t]*(?:
\( [^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*(?: \@ [\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*
(?'domain'(?:[^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff])|\[(?:
[^\\\x80-\xff\n\015\[\]""] | \\ [^\x80-\xff] )*\])[\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*(:?\. [\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*
(?:[^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff])|\[(?:
[^\\\x80-\xff\n\015\[\]""] | \\ [^\x80-\xff] )*\])[\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff]| \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*)*)(?: , [\040\t]*(?:
\( [^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )* \@ [\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*
(?'domain'(?:[^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff])|\[(?:
[^\\\x80-\xff\n\015\[\]""] | \\ [^\x80-\xff] )*\])[\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?:\\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*(:?\. [\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\)[\040\t]* )*
(?:[^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff])|\[(?:
[^\\\x80-\xff\n\015\[\]""] | \\ [^\x80-\xff])*\])[\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*)*))*:[\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*
)?(?'localpart'(?:[^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff])|(?'quotedstr'\""[^\\\x80-\xff\n\015""]
*(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015""] * )*\"")) [\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*(?:\. [\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\[^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*
(?:[^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff])|(?'quotedstr'\""[^\\\x80-\xff\n\015""]
*(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015""] * )*\"")) [\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?:\\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*)*) \@ [\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*
(?'domain'(?:[^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff])|\[(?:
[^\\\x80-\xff\n\015\[\]""] | \\ [^\x80-\xff] )*\])[\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*(:?\. [\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*
(?:[^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>\@,;:\"".\\\[\]\000-\037\x80-\xff])|\[(?:
[^\\\x80-\xff\n\015\[\]""] | \\ [^\x80-\xff] )*\])[\040\t]*(?: \(
[^\\\x80-\xff\n\015()] *(?:(?: \\ [^\x80-\xff] | \(
[^\\\x80-\xff\n\015()] *(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()]
*)*\)) [^\\\x80-\xff\n\015()] *)*\) [\040\t]* )*)*)>)$"))

End Function
Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: unndunn | last post by:
I'm trying to design a regular expression that matches (using preg_match()) when a string is a well-formed Email address. So far I have this: /^+@+\.{2,4}$/i I got that from...
13
by: Eddie | last post by:
I need to validate a text input field. I just want to say if user enters 93101 or 93102 or 93103 or 93105 or 93106 or 93107 or 93108 or 93109 or 93110 or 93111 or 93116 or 93117 or 93118 or...
12
by: Dag Sunde | last post by:
My understanding of regular expressions is rudimentary, at best. I have this RegExp to to a very simple validation of an email-address, but it turns out that it refuses to accept mail-addresses...
5
by: Dave | last post by:
Hello. Is there any method to validate if string contains valid IP address? I also need the method to valideta email address in string. Thank you.
35
by: Mika M | last post by:
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...
23
by: codefire | last post by:
Hi, I am trying to get a regexp to validate email addresses but can't get it quite right. The problem is I can't quite find the regexp to deal with ignoring the case james..kirk@fred.com, which...
0
by: pramodjava | last post by:
HI , I am trying to validate an email in vb6.0 using regular expressions, how can i do this , Thnaks
20
numberwhun
by: numberwhun | last post by:
Hello everyone! I am still learning (TONS every day) and having an absolute blast. Unfortunately, I have an issue that is puzzling and bewildering me. Seeing as how the best way to learn is to...
5
by: Ganesh | last post by:
Hi There, I need to validate email address with regular expression control, i tried something like this ^+*@*\.*$ but i need to validate even if it is blank, it should say invalid email,...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.