fork(1) download
  1. <?php
  2.  
  3. $username = "user gmail.com";
  4.  
  5. if (!preg_match('/^[\w-.@]+$/', $username)) {
  6. echo 'nao passou';
  7. } else{
  8. echo 'passou';
  9. }
  10.  
  11. echo ' / ';
  12.  
  13. $username = "user@_gmail.com";
  14.  
  15. if (!preg_match('/^[\w-.@]+$/', $username)) {
  16. echo 'nao passou';
  17. }else{
  18. echo 'passou';
  19. }
Success #stdin #stdout 0.02s 23572KB
stdin
Standard input is empty
stdout
nao passou / passou