LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-25-2005, 06:44 PM   #1
Hockeyfan
Member
 
Registered: May 2004
Distribution: SuSe 10.0
Posts: 154

Rep: Reputation: 30
Regualr expression for email verification


can anyone tell me if this is the correct regular expression for an email expression. Keep in mind I would like to use this expresdsion in a webpage that utilizes Cold Fusion MX technology.

"^[0-9a-z_-]([.]?[0-9a-z_-])*" . "@[0-9a-z_-]([.]?[0-9a-z_-])*"

Thanks,

-Hockeyfan
 
Old 08-26-2005, 12:37 PM   #2
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 36
Code:
"^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zAZ0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"
try this. I don't know coldFusion but it does work for email addresses in other situations.
 
Old 08-26-2005, 01:34 PM   #3
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
I once wrote a regular expression to validate that an e-mail address conformed to the format specified by RFC 822. Unfortunately, that regular expression was long, ugly, and very slow so I cut it back a bit. I think I had originally created it to allow the "Name <emailaddress>" format too, but cut that out because it was part of what really slowed it down.

Much of the stuff possible in RFC 822 is stuff you will most likely never see in modern e-mail addresses, but it is an interesting read. Still, I'd hate to be the person with an e-mail address like
"\<Dan Jenkins\@ugh\>"@[someroutinginfo]someplace.com
and have to get that to validate against most of the simple regular expressions most websites use for validation.

Last edited by deiussum; 08-26-2005 at 01:47 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Patch Verification jfvanmeter Linux - Security 1 10-24-2005 01:47 PM
What is MD5 Verification anindyanuri Linux - Networking 7 03-31-2005 10:06 AM
adding root permisions to regualr user paul62 Linux - Newbie 6 10-27-2004 02:10 PM
re: how to md5 for verification ergo_sum Linux - Software 2 11-02-2003 10:18 AM
kernel verification.... roofy Linux - Software 4 05-05-2003 03:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration