Re: [PHP] Regex validation

2008-10-30 Thread Yeti
After ceo posted about the imap function I was eager to try it out and got rather disappointed pretty soon. imap_rfc822_parse_adrlist() should not be used for email validation! EXAMPLE: ?php var_dump(imap_rfc822_parse_adrlist('! # $ % * + - / = ? ^ _ ` { | } ~', '')); ? The above code will

Re: [PHP] Regex validation

2008-10-30 Thread ceo
var_dump(imap_rfc822_parse_adrlist('! # $ % * + - / = ? ^ _ ` { | } ~', '')); This looks like a valid localhost email address to me... What's wrong with it? :-v You may want to check that host is non-empty, if you do not expect any localhost users, and fail on that condition,

Re: [PHP] Regex validation

2008-10-30 Thread Yeti
ceo wrote: var_dump(imap_rfc822_parse_adrlist('! # $ % * + - / = ? ^ _ ` { | } ~', '')); This looks like a valid localhost email address to me... It surely is a valid localhost email address, but what most people (and the OP) usually need is to validate a full email string with a local and a

Re: [PHP] Regex validation

2008-10-29 Thread Bastien Koert
On Tue, Oct 28, 2008 at 8:57 PM, VamVan [EMAIL PROTECTED] wrote: SSO process: $_POST the Email Address and password Get Authenticated, Get the COOKIE ( Through Oracle IDM suite SOAP call) Decrypt the COOKIE ( Through Oracle Enterprise business suite SOAP call) and get the profile Info

Re: [PHP] Regex validation

2008-10-29 Thread ceo
When it comes to email validation, I would recommend using the IMAP function which will be both fast and correct: http://us.php.net/manual/en/function.imap-rfc822-parse-adrlist.php Otherwise, it's guaranteed that you are having at least some false positives, and probably some false

Re: [PHP] Regex validation

2008-10-29 Thread Yeti
On Wed, Oct 29, 2008 at 5:36 AM, [EMAIL PROTECTED] wrote: When it comes to email validation, I would recommend using the IMAP function which will be both fast and correct: http://us.php.net/manual/en/function.imap-rfc822-parse-adrlist.php Otherwise, it's guaranteed that you are having at

[PHP] Regex validation

2008-10-28 Thread VamVan
Hello Team of Nerds, I need help in writing a regular expression for this: invalid character set is: INVALID_STRING={/,*,+,(,),'\',:,;,~,..,.@,@.}; I want to a pregmatch for these characters on my whole email address and if match is found I need to return false. Thank you

Re: [PHP] Regex validation

2008-10-28 Thread Daniel P. Brown
On Tue, Oct 28, 2008 at 4:10 PM, VamVan [EMAIL PROTECTED] wrote: Hello Team of Nerds, I need help in writing a regular expression for this: invalid character set is: INVALID_STRING={/,*,+,(,),'\',:,;,~,..,.@,@.}; Then you need to STFW and RTFM. PHP uses Perl-style regexp's, by the

Re: [PHP] Regex validation

2008-10-28 Thread Richard Heyes
Hello Team of Nerds, Not the best way to start your request for help. I need help in writing a regular expression for this: invalid character set is: INVALID_STRING={/,*,+,(,),'\',:,;,~,..,.@,@.}; I want to a pregmatch for these characters on my whole email address and if match is

Re: [PHP] Regex validation

2008-10-28 Thread Micah Gersten
VamVan wrote: Hello Team of Nerds, I need help in writing a regular expression for this: invalid character set is: INVALID_STRING={/,*,+,(,),'\',:,;,~,..,.@,@.}; I want to a pregmatch for these characters on my whole email address and if match is found I need to return false.

RE: [PHP] Regex validation

2008-10-28 Thread Boyd, Todd M.
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Richard Heyes Sent: Tuesday, October 28, 2008 4:30 PM To: VamVan Cc: php List Subject: Re: [PHP] Regex validation Hello Team of Nerds, Not the best way to start your request for help. I

Re: [PHP] Regex validation

2008-10-28 Thread Yeti
If your trying to filter E-Mail addresses, then filter_var is what you should use: http://php.net/filter_var If the OP (original poster) got PHP5+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Regex validation

2008-10-28 Thread Nitsan Bin-Nun
Good to know filter_var() exists in PHP5 Unless you have PHP5 you better validate the string in the way of checking if it is fit's to your allowed characters and not checking if it contains the NOT allowed charaters. You better use: [a-z0-9A-Z\_\.]+ instead of [^\)\(\*\[EMAIL PROTECTED] and I

Re: [PHP] Regex validation

2008-10-28 Thread VamVan
Thank Guys, I at least got part of it working , not the double words but almost everything else than that: function _email_validate($mail_address){ $invalid_charset_pattern = [(*+?)|~:;{}/ ]; if(ereg($invalid_charset_pattern, $mail_address)){ return false; }else{ return true; } }

Re: [PHP] Regex validation

2008-10-28 Thread Micah Gersten
Keep in mind that ereg will disappear with PHP 6. You might want to use the preg functions: http://www.making-the-web.com/2007/09/21/becoming-php-6-compatible/ Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com VamVan wrote: Thank Guys, I at least got part

Re: [PHP] Regex validation

2008-10-28 Thread Ashley Sheridan
On Tue, 2008-10-28 at 18:07 -0500, Micah Gersten wrote: Keep in mind that ereg will disappear with PHP 6. You might want to use the preg functions: http://www.making-the-web.com/2007/09/21/becoming-php-6-compatible/ Thank you, Micah Gersten onShore Networks Internal Developer

Re: [PHP] Regex validation

2008-10-28 Thread VamVan
Yeah, I understand that its allowed in RFC. But unfortunately I use SSO layer which decrypts the Cookie to get email address. This is where it messes up. So I have decided not to allow people to use that as well. Thanks On Tue, Oct 28, 2008 at 5:10 PM, Ashley Sheridan [EMAIL PROTECTED]wrote:

Re: [PHP] Regex validation

2008-10-28 Thread Lupus Michaelis
VamVan a écrit : This is where it messes up. So I have decided not to allow people to use that as well. By that way, you're making a lot of ennemies on this very list :D -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Regex validation

2008-10-28 Thread Micah Gersten
What are you talking about with a cookie and an E-Mail address? Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com VamVan wrote: Yeah, I understand that its allowed in RFC. But unfortunately I use SSO layer which decrypts the Cookie to get email address.

Re: [PHP] Regex validation

2008-10-28 Thread VamVan
SSO process: $_POST the Email Address and password Get Authenticated, Get the COOKIE ( Through Oracle IDM suite SOAP call) Decrypt the COOKIE ( Through Oracle Enterprise business suite SOAP call) and get the profile Info Thats what happens now. But there is a glitch in the decryption

Re: [PHP] Regex validation

2008-10-28 Thread Micah Gersten
How is anything but your webserver decrypting the $_POST data? PHP should get it after that as is. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com VamVan wrote: SSO process: $_POST the Email Address and password Get Authenticated, Get the COOKIE (