<?php if (!preg_match('~^[A-Z0-9]*(?:\.[A-Z0-9]*)?$~i', 'abc.def.ghi')){ echo "Invalid Username";}
Standard input is empty
Invalid Username
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!