This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: grep -P regexp problem



This is not cygwin-specific, so it is really OT for this list, that
being said...
Sorry. I will try to figure out where to go then.

grep -P treats the whole input as a single string, and outputs the
line (or lines) containing the match for the pattern. [^0] matches ANYTHING except 0, including linefeeds.

I guess I oversimplified the regexp :-(


G:\>cat test.s | grep -P "^[^0]1"


G:\>cat test.s | grep -P "^(|[^0])1" 1

G:\>cat test.s | grep -P "^(|.*[^0])1"
a
1

Thanks,
Andriy


-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]