Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with a regular expression for email

Status
Not open for further replies.

Larsson

Programmer
Jan 31, 2002
140
SE
Hi!

I need to validate that an email is correct and I use the following regular expression:
^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$
(Ignore case is true)

But Access has problem with this expression.
A correct email doesn't pass through (foo@bar.com).
If I remove ^ from the expression foo@bar.com gets validated. But so will fo o@bar.com.
Let’s say that that is ok, next problem is that it also accepts unusual characters, like á, and åäö.
This even when the expression doesn’t include these characters.

I have used regular expressions before in Access, and I have never had any problems like these.

I need help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top