git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git grep and word boundaries

From
LRLuciano Rocha <luciano@eurotux.com>
Date
May 27, 2008, 08:56 UTC
Message-ID
<20080527085612.GA31765@bit.office.eurotux.com>
In-Reply-To
<483BC7E2.6090804@gmx.net>
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/>
Previous: Thomas Volpini
Message 2 of 2 in “git grep and word boundaries”
  1. Thomas VolpiniMay 27, 2008
  2. Luciano RochaMay 27, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.