diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-01-22 20:19:33 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-01-22 20:19:33 +0100 |
commit | 49eb38b409de8a7aa6ed29c185ce208e4f0c0ec5 (patch) | |
tree | 3c96d947ed0afe4f9b0a4eaa5cbf6fa497873bb6 | |
parent | 05aa5616d7aa7b4dea2c882ad5518571f3b790a8 (diff) |
Update the READMEv2.0.0
-rw-r--r-- | README.md | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -36,9 +36,9 @@ command is optional. For example, a pattern string may look like ‘`x/[a-z]+/ g.foo. v/bar/`’. -The available operators are ‘g’, ‘G’, ‘x’, and ‘X’. The ‘g’ and ‘G’ -operators are filter operators, while ‘x’ and ‘X’ are selection -operators. +The available operators are ‘g’, ‘G’, ‘h’, ‘H’, ‘x’, and ‘X’. The ‘g’ +and ‘G’ operators are filter operators, the ‘h’ and ‘H’ operators are +highlighting operators, and ‘x’ and ‘X’ are selection operators. You probably want to begin your pattern with a selection operator. By default the entire contents of the file you’re searching through will be @@ -90,6 +90,21 @@ following: grab 'x/[0-9]+/ g/3/ G/^1337$/' /foo/bar ``` +The final set of operators are highlighting operators. They don’t change +the text that is ultimately matched in any manner, but instead highlight +the matched text in the output. If given the empty regular expression +the ‘h’ operator will highlight according to the same regular expression +as the previous operator. + +The following examples select words with a capital letter, and highlights +all the capital letters: + +```sh +# These are both the same +grab 'x/\w+/ g/[A-Z]/ h/[A-Z]/' /foo/bar +grab 'x/\w+/ g/[A-Z]/ h//' /foo/bar +``` + ## Examples |