This commit is contained in:
Miloslav Ciz 2024-08-27 22:53:54 +02:00
parent 3816e78230
commit 1ed9079ad4
50 changed files with 1892 additions and 1863 deletions

View file

@ -50,7 +50,7 @@ Here we'll demonstrate some practical uses of regular expressions. Most common [
The most basic use case is you just wanting to **search** for some pattern in a file, i.e. for example you are looking for all [IP addresses](ip_address.md) in a file, for a certain exact word inside source code comment etc.
The following uses grep to find and count all occurences of the word `capitalism` or `capitalist` (disregarding case with the `-i` flag) in a plain text version of [this wiki](lrs_wiki.md) and passes them to be counted with *wc*.
The following uses grep to find and count all occurrences of the word `capitalism` or `capitalist` (disregarding case with the `-i` flag) in a plain text version of [this wiki](lrs_wiki.md) and passes them to be counted with *wc*.
`grep -i -o "capitalis[mt]" ~/Downloads/lrs_wiki.txt | wc -l`