From 6ffd434232b46df4f94bd3db9197f154aca7d2f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rory=20O=E2=80=99Kane?= Date: Tue, 16 Apr 2019 17:21:40 -0400 Subject: [PATCH] readme: mention --auto-hybrid-regex in advantages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This feature solves a major reason I was skeptical of using ripgrep, so I think it’s good to mention it in the section about why one should use it. I use backreferences a lot, so I had previously thought that ripgrep would provide no speed advantage over ag, since I would always have `-P` enabled. But when I saw `--auto-hybrid-regex` in the 11.0.0 changelog, I learned that ripgrep can use it to speed up simple queries while still allowing me to write backreferences. PR #1253 --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 14101f67..3b4e3e3c 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,8 @@ increases the times to `2.640s` for ripgrep and `10.277s` for GNU grep. * ripgrep has optional support for switching its regex engine to use PCRE2. Among other things, this makes it possible to use look-around and backreferences in your patterns, which are not supported in ripgrep's default - regex engine. PCRE2 support is enabled with `-P`. + regex engine. PCRE2 support can be enabled with `-P` (use PCRE2 always) or + `--auto-hybrid-regex` (use PCRE2 only if needed). * ripgrep supports searching files in text encodings other than UTF-8, such as UTF-16, latin-1, GBK, EUC-JP, Shift_JIS and more. (Some support for automatically detecting UTF-16 is provided. Other text encodings must be