I have a mixed wordlist as an input:
azert12345
a1z2e3r4t5
a1z2e3r455
The command line I have tried to execute:
cat file.txt | grep -E "[[:digit:]]{5}" --color
What do I want to accomplish:
Print only these words: "azert12345" and "a1z2e3r4t5", using grep
with a pattern like I said before. Something like grep -E "[[:digit:]]{5}"
.
It is easy to print words like "azert12345" using grep -E "[[:alpha:]]{5}[[:digit:]]{5}"
with a maximum number of digits of 5 and a maximum number of alphabetical characters as 5, but the problem is: How am I going to print the mixed ones like this one a1z2e3r4t5?
The "a1z2e3r4t5" is just an example the mount of data i should deal with is so much biger
This problem is driving me to crazy for 3 days, and it is not a homework. I'll start learning again more about linux commands. I need some help.