I\'m working on an email validation regex in PHP and I need to know how long the TLD could possibly be and still be valid. I did a few searches but couldn\'t find much infor
This is PHP code to get up-to-date vertical bar separated UTF-8 TLDs list to be used directly in a regular expression:
PHP
UTF-8
To match a host name you could use it like this:
$tlds=getTLDs('|'); if (preg_match("{([\da-z\.-]+)\.($tlds)}u",$address)) { .. }