I have to search in many files with several lines, the lines with a telephone number of exactly ten digits. Examples of the lines:
telephoneNumber: 66727166501
telephoneNumber: 6672716650
telephoneNumber: 66727166
telephoneNumber: 6672716651
So I am expecting the lines:
telephoneNumber: 6672716650
telephoneNumber: 6672716651
I am using the next grep instruction for the search:
grep '^telephoneNumber: [0-9]\{10\}$' file.txt
It works fine in Ubuntu, OpenSuse and Cygwin, but when I run it in Solaris, it does not do the match, if a delete the $
at the end of the pattern, it does match, but is taking it like "at least 10 digits"
Any suggestions?