Assuming sentence
“The time is now 8:15pm. Followed by some other text”
Why would the following regex not match the line?
egrep '\<[1-9]\s*:\s*[0-9]{2}\s*[Pp][Mm]\>' file
I am on MAC, using GNU egrep
$ egrep –version egrep (GNU grep) 2.5.1
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Totally unable to reproduce.
Mac OS X 10.7:
So you’re wrong about something somewhere…
EDIT Ah, the problem is the space. egrep doesn’t recognize
\s; that’s a Perlism. Your question didn’t include the space there.