fork download
  1. <?php
  2. $text = "john123 john william johnw@hotmail.com 2015-05-09 13:21:41 2015-08-07 13:21:41 James James William William group1 2015-05-30 18:05:39";
  3.  
  4. $regex = '~([a-zA-Z]+) ([a-zA-Z]+ [a-zA-Z]+) ([-\w.+]+@[-\w.+]+\.[a-zA-Z]{2,4}) (\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) (\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) ([a-zA-Z]+ [a-zA-Z]+) ([a-zA-Z]+ [a-zA-Z]+) ([a-zA-Z]+) (\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})~i';
  5.  
  6. if ( preg_match( $regex, $text ) ) {
  7. echo $text . " is a valid text. We can accept it.";
  8. } else {
  9. echo $text . " is an invalid text. Please try again.";
  10. }
  11. ?>
  12.  
  13.  
Runtime error #stdin #stdout #stderr 0s 4476KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
/spoj/php_run: line 1: exec: php: not found