develooper Front page | perl.beginners | Postings from February 2002

RE: select text

Thread Previous | Thread Next
John Edwards
February 5, 2002 09:25
RE: select text
Message ID:
You can use the following code...

$email = 'Name LastName <>';
$email =~ /<([\w@.]+)>/;
$email = $1;
print $email;

As you seem relatively new to this, here is a breakdown

$email = 'Name LastName <>';
# 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 ;)



-----Original Message-----
From: Roman Fordinal []
Sent: 05 February 2002 17:11
Subject: select text

  i need get e-mail adrees from string
  $email="Name LastName <>"

  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

To unsubscribe, e-mail:
For additional commands, e-mail:

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.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About