On Thursday 22 January 2004 09:31, Richard Miller wrote: > (Am I asking this just 10 hours premature?)
Most definately..... There will be a lot of things there that will help you a lot in this, although several might not work in php, we'll have to check. First of all, see if php supports \w (alphanumberic classes, much more readable than your range classes [a-zA-Z0-9].. and in perl, unicode compilant). Also, you might want to use some lookahead assertions, to try and map out the number of domains. Should parse faster. But really, if you want to catch all nuances of an email, this one won't work. Unless you are already parsing out things like "Name" from the email. At the end of the Mastering Regular Expressions book, (O'Reilly), at least my first edition, (pg 316) that is 6,598 bytes. Just to handle everything, and show it done in a single regex. PHP should have some prebuilt class out in the wild for doing this already. I know Perl has some good ones that I will always prefer over my own regex for this. A) prebuilt, B) tested, C) OO interface D) Catches things I didn't know were legal, E) Catches a lot of broken things too -- -- Jayce^
pgp00000.pgp
Description: signature
____________________ BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________ List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
