Blog This!   Lee Geistlinger's Web Log
Blog Home
Blog Archives
LittleGhost Home

E-mail: geistlinger AT gmail.com

Loading
Pic 'O the Day
Top 10 Lists
Everyone loves lists
Reviews
Books, Movies and so on
Blogroll
Feed Me!

XML Feed

Feeds I Read

My Online Aggregator

Theme
• Default
• Spring
• Summer
• Autumn
• Winter
• Black & White
• Gray & White
• MT-ish
• Classic
Listening To...
Evidence of Efforts

This page is powered by Blogger. Isn't yours?

Valid CSS!

[Valid RSS]

Recent Posts
 Sunday, December 14, 2003
More Geek Speak

Just as a way of remembering - for me - here is the way to do a nice regex e-mail check in PHP:
// validate name

if (eregi("^([a-zA-Z0-9])+([.a-zA-Z0-9_-])+
@([a-zA-Z0-9_-])+\.([a-zA-Z]{2,4})$",
$email)) {
$message = "valid e-mail";
}
else {
$message = "INVALID e-mail";
}

This is slightly different from the Perl version I've posted earlier; mainly, have to drop the backslash before the allowable dot (.) in the e-mail prefix (before the @ sign). And - duh! - it's written in PHP lingo, not Perl. Concept pretty much exactly the same, however.

- Posted by Lee at 2:09 PM Permalink #
^Top | Top Ten Home | Blog This! Home | Blog This! Archives