From 0579b0993cdb95c069d95c48d5983aadeb21a1a0 Mon Sep 17 00:00:00 2001 From: thalesmello Date: Mon, 4 Jul 2016 17:40:04 -0300 Subject: [PATCH] Fix extended regular expressions By default, grep already uses regular expressions when searching. The example `grep -e {{^regex$}} {{path/to/file}}` is the same as `grep {{^regex$}} {{path/to/file}}`. However, because of the comment about extended regular expressions, I mistakenly assumed `-e` was the option to enable it. I believe most people would refer to `tldr` in this use case looking for the `-E` extended regular expressions. With this in mind, I believe that example would be better rephrased as this pull request makes it. --- pages/common/grep.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/common/grep.md b/pages/common/grep.md index 916119b55..44a4f6856 100644 --- a/pages/common/grep.md +++ b/pages/common/grep.md @@ -15,9 +15,9 @@ `grep -rI {{search_string}} .` -- Use a regular expression (`-E` for extended regex, supporting `?`, `+`, `{}`, `()` and `|`): +- Use extended regular expressions (supporting `?`, `+`, `{}`, `()` and `|`): -`grep -e {{^regex$}} {{path/to/file}}` +`grep -E {{^regex$}} {{path/to/file}}` - Print 3 lines of context around each match: