0
sed '/\(.*\..*\)\{4,\}/d'

The above command mentioned recognizes every DOT in the line...

It is recognizing DOTS after @ sign too. For example, even this is shown in the result: [email protected]

Can you help me modify the above command in such a way that only the LEFT side of @ it counts the Multiple DOTS more than 3 and ignores the DOTS after the character @ to right side of the email?

Eg:

[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

I want the following lines with multiple Dots (3 or more dots) at the LEFT SIDE of @ Character to be only recognizers and deleted from the file.

[email protected]
[email protected]
[email protected]

Any experts, plz suggest me how to modify the above SED command.... Thanks

1 Answer 1

0

I'm not an expert but, to delete only the 4 dots (or more) patterns at the left side of @ you can simply add @.* at the end of your expression:

sed '/\(.*\..*\)\{4,\}@.*/d'

It means to delete the 4 dots (or more) patterns at the left side of the @ regardless what characters are at the right side.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .