bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep -w and \w -pattern


From: Stepan Kasal
Subject: Re: grep -w and \w -pattern
Date: Mon, 2 Jun 2003 16:01:43 +0200
User-agent: Mutt/1.2.5.1i

Hello,

On Mon, Jun 02, 2003 at 03:50:03PM +0300, Jori Mantysalo wrote:
> address@hidden jori]$ echo "dogs dogs dogs" | grep -o -w "\w\w\w"

this is OK, of course.

> Is this a bug:
> address@hidden jori]$ echo "dogs dogs and dogs" | grep -o -w "\w\w\w"
> dog
> dog
> and
> dog

But this is a bug.  This surely will be fixed one day...

Thank you very much for reporting the bug, I'll file it; it won't be
forgotten.

For now, please don't use -o in combination with -w.
Use \< and \> instead, like this:

        $ echo "dogs dogs and dogs" | grep -o "\<\w\w\w\>"
        and

Hope this helps,
        Stepan Kasal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]