aboutsummaryrefslogtreecommitdiff
path: root/man/grab.1
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-01-22 20:04:50 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-01-22 20:04:50 +0100
commit167d40913908562af9e38f233481cbc528f9a904 (patch)
tree3d640e5d44a92936dacdebd4a7596dd320a6aa63 /man/grab.1
parent53fbc50fa5dd0ae712c202d7c7dfda62e39bc2c4 (diff)
Document the behavior of an empty h//
Diffstat (limited to 'man/grab.1')
-rw-r--r--man/grab.117
1 files changed, 17 insertions, 0 deletions
diff --git a/man/grab.1 b/man/grab.1
index e2f90c6..1104e20 100644
--- a/man/grab.1
+++ b/man/grab.1
@@ -209,6 +209,23 @@ filters out the specific number 1337.
As you may use whichever delimiter you like, the following is also valid:
.Pp
.Dl x|[0\-9]+| g.3. G#^1337#
+.Pp
+Operators are not allowed to take empty regular expression arguments with
+one exception:
+.Sq h .
+When given an empty regular expression argument,
+the
+.Sq h
+operator assumes the same regular expression as the previous operator.
+This allows you to avoid duplication in the common case where a user
+wishes to highlight text matched by a
+.Sq g
+operator.
+The following example pattern selects all words that have a capital
+letter,
+and highlights the capital letter(s):
+.Pp
+.Dl x/\ew+/ g/[A\-Z]/ h//
.Sh ENVIRONMENT
.Bl -tag -width GRAB_COLORS
.It Ev GRAB_COLORS