How to print all lines that has exactly 3 occurences of digit 4 using grep?
I am able to find the pattern if it is for atleast 3 occurences but with exactly 3 occurences? Can anybody help me on this.
How to print all lines that has exactly 3 occurences of digit 4 using grep?
I am able to find the pattern if it is for atleast 3 occurences but with exactly 3 occurences? Can anybody help me on this.
grep "^[^4]*4[^4]*4[^4]*4[^4]*$" file
Another syntax using egrep :
egrep '^([^4]*4[^4]*){2}$'
Jean-Pierre.
Anbu and Pierre, thank u very much for ur reply...its working...