fork(1) download
  1. <?php
  2. $text = "Мыло раз victory1@gmail.com
  3. мыло два failure13@yahoo.com";
  4. $regexp = "/[a-z0-9_+.-]+@[a-z.-]+/i";
  5. $emails = array();
  6. $count = preg_match_all($regexp, $text, $emails);
  7. for ($i = 0; $i < $count; $i++) {
  8. echo $emails[0][$i] . "\n";
  9. }
  10.  
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
victory1@gmail.com
failure13@yahoo.com