fork download
  1. <?php
  2. $regexp='/[a-zA-Z0-9\\.\\-\\+]+@[a-zA-Z0-9\\.\\-\\+]+[\\.]([a-zA-Z0-9\\.\\-\\+]+[\\.])?[a-zA-Z0-9\\.\\-\\+]+/';
  3. $text="you+me@some.domain-domain.com";
  4. $matches=array();
  5. preg_match_all($regexp, $text, $matches);
  6.  
  7. var_dump($matches);
Success #stdin #stdout 0.02s 24192KB
stdin
Standard input is empty
stdout
array(2) {
  [0]=>
  array(1) {
    [0]=>
    string(29) "you+me@some.domain-domain.com"
  }
  [1]=>
  array(1) {
    [0]=>
    string(0) ""
  }
}