$tok = strtok( $inputed, "," ); while ( $tok !== false ) { if( eregi( '^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$', trim( $tok ) ) ) { $addr = trim($tok); /* ...... */ } $tok = strtok( "," ); } this sometimes correctyl tokenize emails with subdomains like a@x.foo.com, b@y.foo.com, but sometimes NOT (on another server) and it matches NOTHING. wtf?!?!