* Matching newlines in M-x rgrep?
@ 2023-07-25 7:36 PierGianLuca
0 siblings, 0 replies; only message in thread
From: PierGianLuca @ 2023-07-25 7:36 UTC (permalink / raw)
To: help-gnu-emacs
Hi everyone,
I'm trying to do a regexp search across some files using M-x rgrep. The pattern contains a newline. With isearch-forward-regexp I would use
\$\$\(.\|^J\)*?\$\$
where "^J" is entered via quoting (C-q).
When I use this search string with M-x rgrep, however, I get the following error:
find -H . -type d [...] -exec grep --color=auto -i -nH --null -e \\\$\\\$\\\(.\\\|'
'\\\)\*\?\\\$\\\$ \{\} +
grep: Unmatched ( or \(
grep: Unmatched ) or \)
I believe it's simply because the shell's grep uses a slightly different regexp format (or am I wrong?). Searching for solutions online seems to suggest modifying how Emacs calls rgrep, possibly adding "-P" to it. So I tried to customize the grep-command variable, but I'm not getting anywhere.
Any suggestions, in general, on how to match a newline in M-x rgrep?
I'm on a Linux system.
Cheers!
Luca
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-07-25 7:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-25 7:36 Matching newlines in M-x rgrep? PierGianLuca
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.