threads / discuss / 13682

git grep and word boundaries

Subject: git grep and word boundaries

## tl;dr

2 messages between May 27, 2008 and May 27, 2008.

replies: 1people: 2as markdown or json

Thomas Volpini· May 27, 2008, 08:35 UTC · lore
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· May 27, 2008, 08:56 UTC · re: Thomas Volpini · lore

Re: git grep and word boundaries

On Tue, May 27, 2008 at 10:35:46AM +0200, Thomas Volpini wrote:
Show 15 quoted lines
>  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/>

← back to recent threads