Re: Regular Expression Problem

2007-06-15 Thread Pierre-Yves Ritschard
On Thu, 14 Jun 2007 18:49:46 +0200 OBSD <[EMAIL PROTECTED]> wrote: > Hi All, > > thanks for all the suggestions. > With this it works: > cat mail.txt | egrep "[EMAIL PROTECTED]" | egrep > "\.[a-zA-Z]{2,4}$" > > It is probably possible to avoid the last egrep but I have not find > out how. > Ha

Re: Regular Expression Problem

2007-06-14 Thread Daniel A. Ramaley
On Thursday 14 June 2007 07:44, you wrote: >I have a problem with regular expressions and can not solve it. >I wants to egrep from a big text file all mail addresses. The first edition of _Mastering Regular Expressions_ by Jeffrey E. F. Friedl has a Perl script which generates a 6.5 kB regex whic

Re: Regular Expression Problem

2007-06-14 Thread Randal L. Schwartz
> "OBSD" == OBSD <[EMAIL PROTECTED]> writes: OBSD> With this it works: For some meaning of "works". Maybe you're not listening, but if someone googles this page, I want to make sure you're corrected. OBSD> cat mail.txt | egrep "[EMAIL PROTECTED]" | egrep "\.[a-zA-Z]{2,4}$" This is *not* a

Re: Regular Expression Problem

2007-06-14 Thread Almir Karic
egrep '[EMAIL PROTECTED],4}$' mail.txt ##<-- you want this, it get's the lines you posted. On 6/14/07, OBSD <[EMAIL PROTECTED]> wrote: Hi Almir, your suggestion does not work completely. What? It misses the [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] I had the same issue as I used c

Re: Regular Expression Problem

2007-06-14 Thread Almir Karic
On 6/14/07, OBSD <[EMAIL PROTECTED]> wrote: Hi All, thanks for all the suggestions. With this it works: cat mail.txt | egrep "[EMAIL PROTECTED]" | egrep "\.[a-zA-Z]{2,4}$" It is probably possible to avoid the last egrep but I have not find out how. egrep '[EMAIL PROTECTED],4}$' mail.txt b

Re: Regular Expression Problem

2007-06-14 Thread OBSD
Hi All, thanks for all the suggestions. With this it works: cat mail.txt | egrep "[EMAIL PROTECTED]" | egrep "\.[a-zA-Z]{2,4}$" It is probably possible to avoid the last egrep but I have not find out how. Regards, Stefan >> I got in the output (Which I not want): >> [EMAIL PROTECTED] -> I beli

Re: Regular Expression Problem

2007-06-14 Thread Andreas Kahari
On 14/06/07, Julian Leyh <[EMAIL PROTECTED]> wrote: > I got in the output (Which I not want): > [EMAIL PROTECTED] -> I believed with [a-zA-Z]{2,4} I can limit it after the "." Or? > [EMAIL PROTECTED] -> It should be as well not possible with [a-zA-Z]{2,4} > > How can I exclude this? You did no

Re: Regular Expression Problem

2007-06-14 Thread Julian Leyh
> I got in the output (Which I not want): > [EMAIL PROTECTED] -> I believed with [a-zA-Z]{2,4} I can limit it after the > "." Or? > [EMAIL PROTECTED] -> It should be as well not possible with [a-zA-Z]{2,4} > > How can I exclude this? You did not say that after the 2-4 characters the line should

Re: Regular Expression Problem

2007-06-14 Thread Randal L. Schwartz
> "OBSD" == OBSD <[EMAIL PROTECTED]> writes: OBSD> I wants to egrep from a big text file all mail addresses. ... OBSD> cat mail.txt | egrep "[EMAIL PROTECTED],4}" That's not even VAGUELY CLOSE to a regex for email addresses. You need to read RFC822 and RFC2822, or just grab the regex at:

Regular Expression Problem

2007-06-14 Thread OBSD
Hi All, I have a problem with regular expressions and can not solve it. I wants to egrep from a big text file all mail addresses. For testing I created this file: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL P