Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

pattern match

by wolverina (Beadle)
on Aug 14, 2002 at 20:39 UTC ( [id://190222]=perlquestion: print w/replies, xml ) Need Help??

wolverina has asked for the wisdom of the Perl Monks concerning the following question:

Any hints on how to parce an email address from a line in a file?
<STRONG><STRONG>user_name\@hotmail.com</STRONG></STRONG> ";
Perhaps use grip to milk the email address from the line? Lisa.

Replies are listed 'Best First'.
Re: pattern match
by Rich36 (Chaplain) on Aug 14, 2002 at 20:57 UTC

    Or you could use Email::Find - "Find RFC 822 email addresses in plain text"

    «Rich36»
My $0.02 on email addys
by BorgCopyeditor (Friar) on Aug 14, 2002 at 20:58 UTC

    perldoc -q mail perldoc -q address perldoc -q valid Email::Valid

    BCE
    --Your punctuation skills are insufficient!

Re: pattern match
by Nightblade (Beadle) on Aug 14, 2002 at 20:46 UTC
    1 way.
    $line =~ /<STRONG><STRONG>(.+)<\/STRONG><\/STRONG>/;

    2 way.

    $line = /([\w\.\-\_]+\@[\w\.\-]+\.\w{2,6})/; $email = $1;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://190222]
Approved by Mr. Muskrat
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-25 07:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found