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 PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
I did the following
cat mail.txt | egrep "[EMAIL PROTECTED],4}"
or
cat mail.txt | egrep "[EMAIL PROTECTED]"
But I did not get which I expected.
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?
As weel I got as output this which I do not want:
[EMAIL PROTECTED]
$ is normall end of a line. But it should not be in a mail address.
[a-zA-Z0-9.-_]+@
I use the "+" here with the meaning the [a-zA-Z0-9.-_] has to be available
min. one of them. Nothing for a @ makes really no sense.
Every help is appreciated.
Thank you.
Regards,
Stefan
--