Reputation: 13
I am trying to grep all lines that have two repeating numbers.
At first I tried grep "[0-9][0-9]"
but this is just asking for lines with two numbers. How do I make it look for two numbers that are the same?
Upvotes: 1
Views: 24
Reputation: 1173
grep -E '([0-9])\1+' <FILENAME>
The '[0-9]' is self-explanatory.
The '\1+' looks for 2 or more occurrences of the same character specified within the grouping
Upvotes: 2