Candid’s brain

After spending about 3 hours searching for why I cannot connect to Google Talk neither using tkabber nor using gajim (I want to move my contact list to another server, as the Google Talk integration into Google Mail seems to be completely unusable), I finally found this bug explaining a problem in openssl. Upgrading to openssl-0.9.8g-r1 didn’t help, but downgrading to 0.9.8f immediately fixed the problem. Finally.

Validate e-mail address

Posted on: May 13th, 2008

This PHP code validates an e-mail address according to all rules of the standards I could find:

(preg_match("((?P[-A-Za-z0-9!#\$%&'*+/=?^_`{|}~]|\\\\[\\x00-\\x7f]|[-A-Za-z0-9!#\$%&'*+/=?^_`{|}~]|\\\\[\\x00-\\x7f][-A-Za-z0-9!#\$%&'*+/=?^_`{|}~.]|\\\\[\\x00-\\x7f])*[-A-Za-z0-9!#\$%&'*+/=?^_`{|}~]|\\\\[\\x00-\\x7f]|\"[\\x00-\\x7f]*[\\x00-\\x5b\\x5d-\\x7f]\")@(?P([-a-z0-9]{1,63}\.)*[-a-z0-9]{1,63}))s", $email, $m) && strlen($m["domain-part"]) <= 255)

http://en.wikipedia.org/wiki/E-mail_address has been updated, I don’t know if my code really follows all rules, as I have found there some I hadn’t known. Please correct my code if you know it better.