On Thu, Apr 12, 2012, at 11:37 AM, Jim Pryor wrote: > On Thu, Apr 12, 2012, at 11:14 AM, John D. Hendrickson and Sara Darnell > wrote: > > Your problem is incorrect so there is no sol'n. > > > > printf 'abc def' | grep -o '^[a-z]' > > > > is only supposed to match against abc. > > > > see grep(1) about pattern matching - there is plenty of online writeups, > > esp posix ieee std. see > > also "ant / antlr" for more about patterns and matching. > > > > Jim Pryor wrote: > > > The following reply was made to PR bin/166842; it has been noted by GNATS. > > > From: Jim Pryor <dubious...@gmail.com> > > > $ printf 'abc def' | grep -o '^[a-z]' > > > will match against each of the letters in 'abc', but not against any of > > > the letters in 'def'. > > > dubious...@gmail.com > > > Hi John, I'm sorry I didn't describe the problem adequately to prevent > this misunderstanding. > $ printf 'abc def' | grep -o '^[a-z]' > Expected output: a > That is in fact the output I get from Gnu grep. > Actual output on FreeBSD: > a > b > c > > The matches against "b" and "c" are incorrect.
The text you quoted was intended to point out that the erroneous behavior only extends to the end of the first word, not to all the characters on the matched line. -- dubious...@gmail.com _______________________________________________ freebsd-bugs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"