• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Please can any one sugest or send me Email validation code.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Please can any one sugest or send me Email validation code.


  • Subject: Re: Please can any one sugest or send me Email validation code.
  • From: leenoori <email@hidden>
  • Date: Thu, 1 Feb 2007 16:26:51 +0100

El 1/2/2007, a las 15:47, Jim Thomason escribió:

There's a regex for it in Jeffrey Friedl's "Mastering Regular
Expressions", from O'Reilly. I think it's like 4,700 characters, IIRC.

BUT - it's actually not -that- bad. For example, being a
do-it-yourselfer, I crafted a regex to match valid email addresses
myself for my perl module Mail::Bulkmail. It's "only" about 900
characters, I think.

The problem is that email addresses can contain comments, and that the
blasted things can recurse infinitely.

email@hidden
foo(this is a comment)@bar.com
foo(this is a (this is a nested comment!) comment)@bar.c(other comment)om


are all the same email address. The regex in the book allowed two
levels of nesting, so it was much longer. Mine allowed no comments (I
stripped them out in an earlier step), so it was much shorter. YMMV.

That's right. You can't parse nested structures with a single regular expression. You can, however, parse them with two separate regular expressions and some supporting code. But yes, it would only be an intellectual exercise.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Please can any one sugest or send me Email validation code. (From: "Marc Wan" <email@hidden>)
 >Re: Please can any one sugest or send me Email validation code. (From: "Jim Thomason" <email@hidden>)

  • Prev by Date: How to get deviceDeltaX/Y from NSScrollWheel..?
  • Next by Date: Re: NSString encoding and perl script encoding
  • Previous by thread: Re: Please can any one sugest or send me Email validation code.
  • Next by thread: Re: Please can any one sugest or send me Email validation code.
  • Index(es):
    • Date
    • Thread