fork download
  1. <?php
  2.  
  3. $re = "/^[a-z0-9_\\.\\-]+@[a-z0-9_\\.\\-]*[a-z0-9_\\-]+\\.[a-z]{2,4}/";
  4. $str = "1231@asdf.com";
  5.  
  6. if (!preg_match($re, $str, $matches) ){
  7. echo 'false';
  8. }
  9. echo 'email ok';
  10.  
Success #stdin #stdout 0.02s 52480KB
stdin
Standard input is empty
stdout
email ok