This is a discussion on regex help needed to parse email within the alt.comp.lang.php forums, part of the PHP Programming Forums category; How do i get the email address from the line below using a regex using eregi_replace or something similar in ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
tgh003@gmail.com wrote:
> How do i get the email address from the line below using a regex using > eregi_replace or something similar in php? > > "Name" <user@example.com> With very simple validating (only checking for something@something): if(preg_match('/<([^>@]+@[^>@]+)>/',$string,$matches)){ $email = $matches[1]; } Grtz, -- Rik Wasmus |