You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/patterns.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -176,6 +176,16 @@ Some common examples of regular expressions:
176
176
-**|** This wildcard makes a logical OR relationship between wildcards. You can thus search something or something else. You may need to add a '\' before this command to avoid the shell thinking you want a pipe.
177
177
-**[^]** This is the equivalent of [!] in standard wildcards, i.e. it is a logical “not” and will match anything not listed within the square brackets.
178
178
179
+
!!! note "Advanced example"
180
+
181
+
This command searches the file `myfile` for lines starting with an “s” and ending with an “n”, and prints them to the standard output.
182
+
183
+
```bash
184
+
$ cat myfile | grep '^s.*n$'
185
+
```
186
+
187
+
Remember to not include the first `$` if you copy the command! It is the prompt!
188
+
179
189
!!! note "Keypoints"
180
190
181
191
- Finding files with specific patterns in their names or content can be done with ``grep`` and ``find``
0 commit comments