JJB has asked for the wisdom of the Perl Monks concerning the following question:
I am using this statement
if (/(abuse\@.*?)\s/)This works fine as long as the email address is surrounded by white space. But sometimes the email address is enclosed with special characters, like this <abuse@tel2.con.it> or [abuse@bog-cnn.jp] or \abuse@fars.stores.info\
((abuse\@.*?)\s/) captures the ending non-alpha characters like this abuse@tel2.con.it> which I don’t want.
I tried this to tighten it up (/(abuse\@[\w\.-_]+)\s/) but it finds nothing.
What is correct syntax??20040620 Edit by Corion: Added formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Capture Email address
by davido (Cardinal) on Jun 20, 2004 at 17:15 UTC | |
by vek (Prior) on Jun 20, 2004 at 18:08 UTC | |
|
Re: Capture Email address
by muba (Priest) on Jun 20, 2004 at 17:12 UTC | |
|
Re: Capture Email address
by graff (Chancellor) on Jun 21, 2004 at 02:18 UTC |