You can use the following code... $email = 'Name LastName <[EMAIL PROTECTED]>'; $email =~ /<([\w@.]+)>/; $email = $1; print $email;
As you seem relatively new to this, here is a breakdown $email = 'Name LastName <[EMAIL PROTECTED]>'; # Just define the data for this demo $email =~ /<([\w@.]+)>/; # This is a regular expression which looks for a left angle bracket < # Followed by either [] # a word character \w # or an at sign @ # or a full stop . # Look for at least one of each of these, but more if possible + # Save the stuff you find using this criteria in the special variable () # But don't look past the right angle bracket # Hopefully that makes some sense ;) $email = $1; # Now store the data that was matched and stored in the special variable $1 back into the $email var print $email; # You know this one, right ;) HTH John -----Original Message----- From: Roman Fordinal [mailto:[EMAIL PROTECTED]] Sent: 05 February 2002 17:11 To: [EMAIL PROTECTED] Subject: select text i need get e-mail adrees from string $email="Name LastName <[EMAIL PROTECTED]>" to $email="[EMAIL PROTECTED]" why get it???? :(((( : :. s pozdravom :.. Roman Fordinal :.. project manager :.: :.: WebCom s.r.o. - Internet Advertising Agency & Design Studio :.: Stanicna 12, Zohor, Slovakia :.: Tel: +421.02.65458251, +421.0907.178147 :.: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------Confidentiality--------------------------. This E-mail is confidential. It should not be read, copied, disclosed or used by any person other than the intended recipient. Unauthorised use, disclosure or copying by whatever medium is strictly prohibited and may be unlawful. If you have received this E-mail in error please contact the sender immediately and delete the E-mail from your system. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]