Date: Thu, 12 Apr 2012 04:10:12 GMT From: Jim Pryor <dubiousjim@gmail.com> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/166842: bsdgrep(1) inconsistently handles ^ in non-anchoring positions Message-ID: <201204120410.q3C4ACqg071289@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/166842; it has been noted by GNATS. From: Jim Pryor <dubiousjim@gmail.com> To: bug-followup@FreeBSD.org Cc: Subject: Re: bin/166842: bsdgrep(1) inconsistently handles ^ in non-anchoring positions Date: Thu, 12 Apr 2012 00:00:46 -0400 On Wed, Apr 11, 2012, at 03:21 PM, Jim Pryor wrote: > I've noticed some more issues with the same version of grep. I don't > know whether they're related, but I'll append them here for now. > > $ printf abc | grep -o '^[a-c]' Some more observations that seem related: $ 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'. On the other hand: $ printf 'abc def' | grep -o '\b[a-z]' $ printf 'abc def' | grep -o '\<[a-z]' will each match against all six of the letters. Matching against the patterns: '[a-z]\b' '[a-z]\>' '[a-z]$' gives correct results. -- dubiousjim@gmail.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204120410.q3C4ACqg071289>