--- On Sun, 9/28/08, Daniel Israel <[EMAIL PROTECTED]> wrote:

> Greetings gang.  Looking for a little help with regular
> expressions that I suck at...  :(
> 
> I have a page where the user can enter a number of email
> addresses separated by white space, comma, or semi-colon.  
> I found some code on the PHP site to split it by comma 
> and/or whitespace, but I wanted to add semicolon.  It 
> looks like so:
> 
> $email = preg_split("/[\s,]+/", $entry);
> 
> So I tried:
> 
> $email = preg_split("/[\s,;]+/", $entry);
> 
> and it seemed to ignore the semicolon.  Any help would be  
> appreciated.  Thanks.

As in your example, $email will be an array.  Try split() which can accept 
regular expressions as well:

$email = split("[; ,]+", $entry);

James

Reply via email to