regex - The correct syntax of a quantifier in a regular expression pattern with grep in Solaris? -


i have search in many files several lines, lines telephone number of ten digits. examples of lines:

telephonenumber: 66727166501  telephonenumber: 6672716650  telephonenumber: 66727166  telephonenumber: 6672716651 

so expecting lines:

telephonenumber: 6672716650  telephonenumber: 6672716651 

i using next grep instruction search:

grep '^telephonenumber: [0-9]\{10\}$' file.txt

it works fine in ubuntu, opensuse , cygwin, when run in solaris, not match, if delete $ @ end of pattern, match, taking "at least 10 digits"

any suggestions?

the cause of problem simple, did not realize because, said, running command in diferent distributions no problem (i not know why) , not cheking files option in text editor

the problem eol of files apply search, originals files did not have unix format, regrettably, creation of these files not under control


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -