diff options
author | Michał Kiedrowicz <michal.kiedrowicz@gmail.com> | 2011-05-09 23:52:05 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-05-09 16:29:33 -0700 |
commit | 63e7e9d8b6483fed555ebed1c79a4820b2ba2558 (patch) | |
tree | 6970e3b85e6870c8fc75eb5704e44c92b1872438 /Documentation | |
parent | grep: Extract compile_regexp_failed() from compile_regexp() (diff) | |
download | tgif-63e7e9d8b6483fed555ebed1c79a4820b2ba2558.tar.xz |
git-grep: Learn PCRE
This patch teaches git-grep the --perl-regexp/-P options (naming
borrowed from GNU grep) in order to allow specifying PCRE regexes on the
command line.
PCRE has a number of features which make them more handy to use than
POSIX regexes, like consistent escaping rules, extended character
classes, ungreedy matching etc.
git isn't build with PCRE support automatically. USE_LIBPCRE environment
variable must be enabled (like `make USE_LIBPCRE=YesPlease`).
Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-grep.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index 4a5837881d..e150c77cff 100644 --- a/Documentation/git-grep.txt +++ b/Documentation/git-grep.txt @@ -12,6 +12,7 @@ SYNOPSIS 'git grep' [-a | --text] [-I] [-i | --ignore-case] [-w | --word-regexp] [-v | --invert-match] [-h|-H] [--full-name] [-E | --extended-regexp] [-G | --basic-regexp] + [-P | --perl-regexp] [-F | --fixed-strings] [-n | --line-number] [-l | --files-with-matches] [-L | --files-without-match] [(-O | --open-files-in-pager) [<pager>]] @@ -97,6 +98,11 @@ OPTIONS Use POSIX extended/basic regexp for patterns. Default is to use basic regexp. +-P:: +--perl-regexp:: + Use Perl-compatible regexp for patterns. Requires libpcre to be + compiled in. + -F:: --fixed-strings:: Use fixed strings for patterns (don't interpret pattern |