# git grep and word boundaries

2 messages from 2008-05-27 to 2008-05-27. Participants: Thomas Volpini, Luciano Rocha.
Thread: https://gitlist.dev/t/13682

## Thomas Volpini, 2008-05-27 08:35

Subject: git grep and word boundaries
Message-ID: <483BC7E2.6090804@gmx.net>
URL: https://gitlist.dev/e/483BC7E2.6090804%40gmx.net

```
Hello,

it seems that git grep doesn't do word boundaries as described:

$ cat bar
foo bar baz
$ grep "\<bar\>" *
foo bar baz
$ git grep "\<bar\>" *
$ git grep -w "\<bar\>" *
$ git grep -w "bar" *
bar:foo bar baz
$ git grep -E "\<bar\>" *
$ git grep -E "\bbar\b" *
$

thanks,
Thomas

```

## Luciano Rocha, 2008-05-27 08:56

Subject: Re: git grep and word boundaries
Message-ID: <20080527085612.GA31765@bit.office.eurotux.com>
URL: https://gitlist.dev/e/20080527085612.GA31765%40bit.office.eurotux.com
In-Reply-To: <483BC7E2.6090804@gmx.net>

```
On Tue, May 27, 2008 at 10:35:46AM +0200, Thomas Volpini wrote:
>  Hello,
> 
>  it seems that git grep doesn't do word boundaries as described:
> 
>  $ cat bar
>  foo bar baz
>  $ grep "\<bar\>" *
>  foo bar baz
>  $ git grep "\<bar\>" *
>  $ git grep -w "\<bar\>" *
>  $ git grep -w "bar" *
>  bar:foo bar baz
>  $ git grep -E "\<bar\>" *
>  $ git grep -E "\bbar\b" *
>  $

It works here. Did you add the file?
$ grep "\<bar\>" *
foo bar baz
$ git grep "\<bar\>"
bar:foo bar baz
$ git grep "\<bar\>" *
bar:foo bar baz
$ git grep \\bbar\\b
bar:foo bar baz
$ git grep \\bbar\\b *
bar:foo bar baz

-- 
Luciano Rocha <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>

```
