bin/166862: grep [[:alnum:]]* only matches once

Jim Pryor dubiousjim at
Thu Apr 12 00:50:14 UTC 2012

>Number:         166862
>Category:       bin
>Synopsis:       grep [[:alnum:]]* only matches once
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 12 00:50:13 UTC 2012
>Originator:     Jim Pryor
>Release:        9.0-PRELEASE
FreeBSD 9.0-PRERELEASE FreeBSD 9.0-PRERELEASE #0: Tue Nov 29 02:45:33 EST 2011 root at amd64
This behaves as expected:
$ printf '_abc d_ef 1ghi' | grep -o '[[:alnum:]_]\+'

But this gives only a single match:
 8:36 PM vaio pts8 .../arch/usr/share/man $ printf '_abc d_ef 1ghi' | grep -o '[[:alnum:]_]*'

Same results if we use egrep instead, or use "\w" instead of "[[:alnum:]_]".

grep version line:
/* $FreeBSD: src/usr.bin/grep/grep.c,v 2011/10/20 16:08:11 gabor Exp $




More information about the freebsd-bugs mailing list