<?php
// your code goes here
function isMail($value)
{
$re = '/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i';
{
return false;
}
return true;
}
print_r(isMail
("123") ?
"true" : "false"); print_r(isMail
("hoge@test.com") ?
"true" : "false"); print_r(isMail
("aaaaa123..@test.com") ?
"true" : "false");
PD9waHAKCi8vIHlvdXIgY29kZSBnb2VzIGhlcmUKCmZ1bmN0aW9uIGlzTWFpbCgkdmFsdWUpCiAgewoKICAJJHJlID0gJy9eKFteQFxzXSspQCgoPzpbLWEtejAtOV0rXC4pK1thLXpdezIsfSkkL2knOwoKICAJaWYgKCFwcmVnX21hdGNoKCRyZSwgJHZhbHVlKSkKICAJewogIAkJcmV0dXJuIGZhbHNlOwogIAl9CgogIAlyZXR1cm4gdHJ1ZTsKICB9CgpwcmludF9yKGRhdGUoIkg6cyIpKTsKcHJpbnRfcigiXG4iKTsKcHJpbnRfcihpc01haWwoIjEyMyIpID8gInRydWUiIDogImZhbHNlIik7CnByaW50X3IoIlxuIik7CnByaW50X3IoaXNNYWlsKCJob2dlQHRlc3QuY29tIikgPyAidHJ1ZSIgOiAiZmFsc2UiKTsKcHJpbnRfcigiXG4iKTsKcHJpbnRfcihpc01haWwoImFhYWFhMTIzLi5AdGVzdC5jb20iKSA/ICJ0cnVlIiA6ICJmYWxzZSIpOwpwcmludF9yKCJcbiIpOw==