in reply to pattern match e-mail addresses
In other words, given a file, print everything that looks like an email address. That's a subtly different question from "is this a valid mail address", or even from "Here's a line with a mail address in it, please parse out the relevant bits."
Embedded newlines could wreak even more havoc.
A lot depends on the dataset, and how you define what addresses you're looking for. For example, barewords are syntactically invalid mail addresses, but if I open an xterm and type "mail postmaster" it will probably get delivered.
This is a stickier problem than it appears. You might try using the 822-valid beast from Mastering Regular Expressions, which you can find here.
And please drop a note to tell us you're on the side of good, and aren't trying to scrape email addresses off a website or something.
Peace,
-McD
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(dkubb) Re: (2) pattern match e-mail addresses
by dkubb (Deacon) on Mar 23, 2001 at 07:27 UTC | |
|
Re: Re: pattern match e-mail addresses
by Fian (Novice) on Mar 23, 2001 at 16:00 UTC | |
by Fian (Novice) on Mar 23, 2001 at 16:05 UTC |