Linux.com

Re:grab email addresses

Posted by: Anonymous Coward on June 01, 2006 10:42 AM
I think the author was going for the regex below:
<tt>egrep -o '[^[:space:]]+\>@[a-zA-Z_\.]+\.[a-zA-Z]{2,3}' somefile</tt>
The one shown doesn't even work. The sqaure brackets are not even balanced.


The "official" regular expression to find an email address runs into more than 6000 characters. You can find some information about it here (random Google search response): <a href="http://www.regular-expressions.info/email.html" title="regular-expressions.info"> How to validate an email address</a regular-expressions.info>



Arvind

#

Return to GNU grep's new features