fork download
  1. <?php
  2.  
  3. function emailFinder($string){
  4. $matches=[];
  5. $regexp='/\b\w+@\w+\.\w+\b/';
  6. preg_match_all($regexp,$string,$matches);
  7.  
  8. foreach ($matches[0] as $key){echo "$key\n";}}
  9.  
  10. emailFinder('rgjgfdlg;l ya@ya.ru pois@ya.ru fdgkfdgdflg rep@rep.ru');
Success #stdin #stdout 0.02s 82624KB
stdin
Standard input is empty
stdout
ya@ya.ru
pois@ya.ru
rep@rep.ru