* how to pass \b to grep on w32?
@ 2005-09-14 1:58 John Steele Scott
0 siblings, 0 replies; 2+ messages in thread
From: John Steele Scott @ 2005-09-14 1:58 UTC (permalink / raw)
Hi,
I am trying to pass the following to M-x grep:
grep -nHr --include=*.c . -e \bWORD\b
On my GNU/Linux system, this works (if I put quotes around the regexp
and include string), but on Windows XP, it doesn't work (no matches are
found, when I know there should be some). If I just have WORD as the
regexp, it works fine, but it's matching DWORD, and I only want to find
WORD (I'm trying to make a 16-bit program 32-bit clean, blech).
It seems to me that something is fouling up the \b part of the regexp.
Can someone tell me how to get the \b through to grep?
I am using Emacs 21.3.50.8 of 2003-12-29 from TEI Emacs, but I have
replaced the grep from TEI by GNU Grep 2.5.1 from the GNUWin32 project.
cheers,
John
^ permalink raw reply [flat|nested] 2+ messages in thread
[parent not found: <mailman.6971.1126663183.20277.help-gnu-emacs@gnu.org>]
* Re: how to pass \b to grep on w32?
[not found] <mailman.6971.1126663183.20277.help-gnu-emacs@gnu.org>
@ 2005-09-14 16:54 ` Eric Pement
0 siblings, 0 replies; 2+ messages in thread
From: Eric Pement @ 2005-09-14 16:54 UTC (permalink / raw)
John Steele Scott wrote:
> I am trying to pass the following to M-x grep:
>
> grep -nHr --include=*.c . -e \bWORD\b
>
> On my GNU/Linux system, this works (if I put quotes around the regexp
> and include string), but on Windows XP, it doesn't work (no matches are
> found, when I know there should be some). If I just have WORD as the
> regexp, it works fine, but it's matching DWORD, and I only want to find
> WORD (I'm trying to make a 16-bit program 32-bit clean, blech).
>
> It seems to me that something is fouling up the \b part of the regexp.
> Can someone tell me how to get the \b through to grep?
You probably need to add double quotes to the search string, and a path
name to begin the search, which should be in forward slashes, not
backslashes. If I omit the path name, my installation of Emacs searches
the same folder where runemacs.exe is stored. Try this:
grep -nHr --include=*.c . -e "\bWORD\b" c:/path/to/start/
That's how it works on my system (WinXP)
--
Eric Pement
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-09-14 16:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-14 1:58 how to pass \b to grep on w32? John Steele Scott
[not found] <mailman.6971.1126663183.20277.help-gnu-emacs@gnu.org>
2005-09-14 16:54 ` Eric Pement
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).