Re: Regular expressions to validate Email addresses

  • From: "Littlefield, Tyler" <tyler@xxxxxxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Tue, 10 May 2011 11:03:23 -0600

>What is the nature of the program which you are writing?
I have to wonder sometimes if you write just to hear yourself speak. does it really matter what the program is?
Anyway, here's how I'd do it. I'm not the best with regex, so...
[a-zA-Z0-9_-]@ then I'd make it match one or more \.[a-xZA-Z0-9-_)s. I'm not really sure how to do the one or more though, I think you can use .? or something similar. Hope that helps a bit.
On 5/10/2011 10:59 AM, Katherine Moss wrote:

What is the nature of the program which you are writing?

*From:*programmingblind-bounce@xxxxxxxxxxxxx [mailto:programmingblind-bounce@xxxxxxxxxxxxx] *On Behalf Of *Mark Matthews
*Sent:* Tuesday, May 10, 2011 12:58 PM
*To:* programmingblind@xxxxxxxxxxxxx
*Subject:* Regular expressions to validate Email addresses

Hello.

I'm probably opening up a can of worms here, since I understand that Email addresses are the most argued over when it comes to regular expressions. I'm just wondering if someone could provide me with a few samples, or point me in the right direction where I can find information on this?

Currently I'm leaning towards JavaScript, to pass to the match() method of the String object an argument to attempt to validate the syntax of a mail address.

Hope this is making sense.

Mark



--

Take care,
Ty
my website:
http://tds-solutions.net
my blog:
http://tds-solutions.net/blog
skype: st8amnd127
"Programmers are in a race with the Universe to create bigger and better 
idiot-proof programs, while the Universe is trying to create bigger and better
idiots.  So far the Universe is winning."
"If Java had true garbage collection, most programs would delete themselves upon 
execution."

Other related posts: