From 10728f1ab485957d66af3940a030b0fb77611fc0 Mon Sep 17 00:00:00 2001 From: marchersimon <50295997+marchersimon@users.noreply.github.com> Date: Mon, 10 May 2021 11:03:12 +0200 Subject: [PATCH] multiple pages: normalize `regular expression` instead of `regex`, `regexp` or `pattern` (#5830) --- pages.fr/common/grep.md | 2 +- pages.fr/common/jest.md | 8 ++++++-- pages.fr/common/z.md | 2 +- pages.id/common/nvim.md | 4 ++-- pages.it/common/ag.md | 2 +- pages.it/common/csvgrep.md | 4 ++-- pages.it/common/vim.md | 6 +++--- pages.pl/common/ack.md | 2 +- pages.pt_BR/linux/csplit.md | 2 +- pages.pt_PT/common/history.md | 2 +- pages/android/logcat.md | 4 ++-- pages/common/csvgrep.md | 4 ++-- pages/common/fgrep.md | 4 ++-- pages/common/gem.md | 2 +- pages/common/grex.md | 2 +- pages/common/httpflow.md | 4 ++-- pages/common/jest.md | 12 ++++++++---- pages/common/linkchecker.md | 4 ++-- pages/common/mlr.md | 2 +- pages/common/mocha.md | 2 +- pages/common/nvim.md | 4 ++-- pages/common/recsel.md | 4 ++-- pages/common/rg.md | 26 +++++++++++++------------- pages/common/sd.md | 2 +- pages/common/sed.md | 4 ++-- pages/common/stow.md | 2 +- pages/common/vim.md | 4 ++-- pages/common/z.md | 2 +- pages/common/zmv.md | 2 +- pages/linux/apt-file.md | 2 +- pages/linux/auracle.md | 2 +- pages/linux/csplit.md | 2 +- pages/linux/inotifywait.md | 2 +- pages/linux/pacman-files.md | 2 +- pages/linux/zgrep.md | 2 +- pages/osx/rename.md | 2 +- pages/osx/sed.md | 2 +- 37 files changed, 74 insertions(+), 66 deletions(-) diff --git a/pages.fr/common/grep.md b/pages.fr/common/grep.md index 2dbd8c7af..bfc9c833d 100644 --- a/pages.fr/common/grep.md +++ b/pages.fr/common/grep.md @@ -18,7 +18,7 @@ - Utilise des expressions rationnelles étendues (supporte `?`, `+`, `{}`, `()` et `|`) : -`grep -E {{^regex$}} {{chemin/vers/fichier}}` +`grep -E {{expression_régulière}} {{chemin/vers/fichier}}` - Affiche 3 lignes de [C]ontexte, avant ([B]efore), ou [A]près chaque concordance : diff --git a/pages.fr/common/jest.md b/pages.fr/common/jest.md index d7bd31dc3..a079913b8 100644 --- a/pages.fr/common/jest.md +++ b/pages.fr/common/jest.md @@ -7,9 +7,13 @@ `jest` -- Exécuter les suites de test des fichiers dont les chemins correspondent aux expressions régulières indiquées : +- Exécuter les suites de test de fichiers donnés : -`jest {{fichier_test1}} {{chemin/vers/fichier_test2.js}}` +`jest {{chemin/vers/fichier1}} {{chemin/vers/fichier2}}` + +- Exécuter les suites de test pour des fichiers, dans le répertoire courant et ses sous-répertoires, dont le chemin correspond à l'expression régulière indiquée : + +`jest {{expression_régulière}} {{expression_régulière}}` - Exécuter les tests dont les noms correspondent aux expressions régulières indiquées : diff --git a/pages.fr/common/z.md b/pages.fr/common/z.md index 9973421cd..315c89fd1 100644 --- a/pages.fr/common/z.md +++ b/pages.fr/common/z.md @@ -1,6 +1,6 @@ # z -> Recherche les répertoires les plus utilisés et permet une navigation rapide à l'aide de chaine de caractères ou de regex. +> Recherche les répertoires les plus utilisés et permet une navigation rapide à l'aide de chaine de caractères ou d'expressions régulières. > Plus d'informations : . - Aller dans un répertoire qui contient "foo" dans son nom : diff --git a/pages.id/common/nvim.md b/pages.id/common/nvim.md index 76660e99e..d2267f507 100644 --- a/pages.id/common/nvim.md +++ b/pages.id/common/nvim.md @@ -24,9 +24,9 @@ `/{{pattern_pencarian}}` -- Melakukan penggantian regex pada seluruh berkas: +- Melakukan penggantian ekspresi reguler pada seluruh berkas: -`:%s/{{pattern}}/{{pengganti}}/g` +`:%s/{{ekspresi_reguler}}/{{pengganti}}/g` - Menyimpan (write) berkas, dan keluar: diff --git a/pages.it/common/ag.md b/pages.it/common/ag.md index 1de882100..67a8535ff 100644 --- a/pages.it/common/ag.md +++ b/pages.it/common/ag.md @@ -25,7 +25,7 @@ - Trova file il quale contenuto soddisfi una determinata espressione regolare: -`ag '{{regexp}}'` +`ag '{{espressione_regolare}}'` - Trova file il quale nome contiene "foo": diff --git a/pages.it/common/csvgrep.md b/pages.it/common/csvgrep.md index 9652d7ca9..34b064cdd 100644 --- a/pages.it/common/csvgrep.md +++ b/pages.it/common/csvgrep.md @@ -8,9 +8,9 @@ `csvgrep -c {{1}} -m {{stringa}} {{data.csv}}` -- Trova righe per le quali le colonne 3 e 4 soddisfano una certa regex: +- Trova righe per le quali le colonne 3 e 4 soddisfano una certa espressione regolare: -`csvgrep -c {{3,4}} -r {{pattern_regex}} {{data.csv}}` +`csvgrep -c {{3,4}} -r {{espressione_regolare}} {{data.csv}}` - Trova righe dove la colonna "nome" NON include la stringa "Mario Rossi": diff --git a/pages.it/common/vim.md b/pages.it/common/vim.md index b49bbe4b2..0d8d64d14 100644 --- a/pages.it/common/vim.md +++ b/pages.it/common/vim.md @@ -22,11 +22,11 @@ - Cerca un pattern nel file (usa `n`/`N` per spostarti al risultato successivo/precedente): -`/{{pattern}}` +`/{{espressione_regolare}}` -- Effettua una sostituzione tramite regex nell'intero file: +- Effettua una sostituzione tramite espressione regolare nell'intero file: -`:%s/{{pattern}}/{{sostituzione}}/g` +`:%s/{{espressione_regolare}}/{{sostituzione}}/g` - Salva modifiche al file ed esci: diff --git a/pages.pl/common/ack.md b/pages.pl/common/ack.md index a37da1da6..1906c7306 100644 --- a/pages.pl/common/ack.md +++ b/pages.pl/common/ack.md @@ -23,7 +23,7 @@ `ack bar "{{foo bar}}" {{scieżka/do/pliku_lub_katalogu}}` -- Przeszukaj plik pod kątem określonego wzorca regex: +- Przeszukaj plik pod kątem określonego wzorca wyrażenia regularnego: `ack bar "{{[bB]ar \d+}}" {{scieżka/do/pliku_lub_katalogu}}` diff --git a/pages.pt_BR/linux/csplit.md b/pages.pt_BR/linux/csplit.md index ed54a9fcf..6e892f21e 100644 --- a/pages.pt_BR/linux/csplit.md +++ b/pages.pt_BR/linux/csplit.md @@ -22,4 +22,4 @@ - Dividir um arquivo na linha que atenda a expressão regular: -`csplit {{arquivo}} /{{regex}}/` +`csplit {{arquivo}} /{{expressao_regular}}/` diff --git a/pages.pt_PT/common/history.md b/pages.pt_PT/common/history.md index 8afe731f6..c7a810bd6 100644 --- a/pages.pt_PT/common/history.md +++ b/pages.pt_PT/common/history.md @@ -16,4 +16,4 @@ - Mostrar as entradas do histórico da linha de comandos que correspondem a uma expressão regular: -`history | grep {{regex}}` +`history | grep {{expressao_regular}}` diff --git a/pages/android/logcat.md b/pages/android/logcat.md index 8b7692235..e804476dc 100644 --- a/pages/android/logcat.md +++ b/pages/android/logcat.md @@ -11,6 +11,6 @@ `logcat -f {{path/to/file}}` -- Display lines that match a regex: +- Display lines that match a regular expression: -`logcat --regex {{regex}}` +`logcat --regex {{regular_expression}}` diff --git a/pages/common/csvgrep.md b/pages/common/csvgrep.md index a898b4971..9ed87c8d1 100644 --- a/pages/common/csvgrep.md +++ b/pages/common/csvgrep.md @@ -8,9 +8,9 @@ `csvgrep -c {{1}} -m {{string_to_match}} {{data.csv}}` -- Find rows in which columns 3 or 4 match a certain regex pattern: +- Find rows in which columns 3 or 4 match a certain regular expression: -`csvgrep -c {{3,4}} -r {{regex_pattern}} {{data.csv}}` +`csvgrep -c {{3,4}} -r {{regular_expression}} {{data.csv}}` - Find rows in which the "name" column does NOT include the string "John Doe": diff --git a/pages/common/fgrep.md b/pages/common/fgrep.md index d3dc9252a..e4e047c47 100644 --- a/pages/common/fgrep.md +++ b/pages/common/fgrep.md @@ -22,8 +22,8 @@ - Display all lines except those that contain the given regular expression: -`fgrep -v {{^regex$}} {{path/to/file}}` +`fgrep -v {{regular_expression}} {{path/to/file}}` - Display filenames whose content matches the regular expression at least once: -`fgrep -l {{^regex$}} {{path/to/file1}} {{path/to/file2}}` +`fgrep -l {{regular_expression}} {{path/to/file1}} {{path/to/file2}}` diff --git a/pages/common/gem.md b/pages/common/gem.md index 05cbf0d60..b69b712a8 100644 --- a/pages/common/gem.md +++ b/pages/common/gem.md @@ -5,7 +5,7 @@ - Search for remote gem(s) and show all available versions: -`gem search {{regexp}} --all` +`gem search {{regular_expression}} --all` - Install latest version of a gem: diff --git a/pages/common/grex.md b/pages/common/grex.md index aa0d1c0f0..8bfbe4128 100644 --- a/pages/common/grex.md +++ b/pages/common/grex.md @@ -7,7 +7,7 @@ ` grex {{space_separated_strings}}` -- Generate a case-insensitive regex: +- Generate a case-insensitive regular expression: `grex -i {{space_separated_strings}}` diff --git a/pages/common/httpflow.md b/pages/common/httpflow.md index 23fa626f5..e21945106 100644 --- a/pages/common/httpflow.md +++ b/pages/common/httpflow.md @@ -11,9 +11,9 @@ `httpflow {{host httpbin.org or host baidu.com}}` -- Use a regexp to filter requests by urls: +- Use a regular expression to filter requests by urls: -`httpflow -u '{{regex}}'` +`httpflow -u '{{regular_expression}}'` - Read packets from pcap format binary file: diff --git a/pages/common/jest.md b/pages/common/jest.md index 943f0f035..4284e3e65 100644 --- a/pages/common/jest.md +++ b/pages/common/jest.md @@ -7,13 +7,17 @@ `jest` -- Run the test suites from files whose paths match the given regex patterns: +- Run the test suites from the given files: -`jest {{test_file1}} {{path/to/test_file2.js}}` +`jest {{path/to/file1}} {{path/to/file2}}` -- Run the tests whose names match the given regex pattern: +- Run the test suites from files within the current and subdirectories, whose paths match the given regular expression: -`jest --testNamePattern {{spec_name}}` +`jest {{regular_expression1}} {{regular_expression2}}` + +- Run the tests whose names match the given regular expression: + +`jest --testNamePattern {{regular_expression}}` - Run test suites related to a given source file: diff --git a/pages/common/linkchecker.md b/pages/common/linkchecker.md index 731b18374..fbc924b6a 100644 --- a/pages/common/linkchecker.md +++ b/pages/common/linkchecker.md @@ -11,9 +11,9 @@ `linkchecker --check-extern {{https://example.com/}}` -- Ignore URLs that match a specific regex: +- Ignore URLs that match a specific regular expression: -`linkchecker --ignore-url {{regex}} {{https://example.com/}}` +`linkchecker --ignore-url {{regular_expression}} {{https://example.com/}}` - Output results to a CSV file: diff --git a/pages/common/mlr.md b/pages/common/mlr.md index 30a35db90..f7cb6b998 100644 --- a/pages/common/mlr.md +++ b/pages/common/mlr.md @@ -29,4 +29,4 @@ - Filter lines of a compressed CSV file treating numbers as strings: -`mlr --prepipe 'gunzip' --csv filter -S '${{fieldName}} =~ "{{regexp}}"' {{example.csv.gz}}` +`mlr --prepipe 'gunzip' --csv filter -S '${{fieldName}} =~ "{{regular_expression}}"' {{example.csv.gz}}` diff --git a/pages/common/mocha.md b/pages/common/mocha.md index f7962a082..3fd21ac2d 100644 --- a/pages/common/mocha.md +++ b/pages/common/mocha.md @@ -13,7 +13,7 @@ - Run tests that match a specific grep pattern: -`mocha --grep {{^regex$}}` +`mocha --grep {{regular_expression}}` - Run tests on changes to JavaScript files in the current directory and once initially: diff --git a/pages/common/nvim.md b/pages/common/nvim.md index fb2f83cf0..c9e7a0fa6 100644 --- a/pages/common/nvim.md +++ b/pages/common/nvim.md @@ -24,9 +24,9 @@ `/{{search_pattern}}` -- Perform a regex substitution in the whole file: +- Perform a regular expression substitution in the whole file: -`:%s/{{pattern}}/{{replacement}}/g` +`:%s/{{regular_expression}}/{{replacement}}/g` - Save (write) the file, and quit: diff --git a/pages/common/recsel.md b/pages/common/recsel.md index 884d62ba4..4962356c2 100644 --- a/pages/common/recsel.md +++ b/pages/common/recsel.md @@ -9,8 +9,8 @@ - Use "~" to match a string with a given regular expression: -`recsel -e "{{field_name}} ~ '{{pattern_regex}}' {{data.rec}}"` +`recsel -e "{{field_name}} ~ '{{regular_expression}}' {{data.rec}}"` - Use a predicate to match a name and a version: -`recsel -e "name ~ '{{pattern_regex}}' && version ~ '{{pattern_regex}}'" {{data.rec}}` +`recsel -e "name ~ '{{regular_expression}}' && version ~ '{{regular_expression}}'" {{data.rec}}` diff --git a/pages/common/rg.md b/pages/common/rg.md index 6ec1635d1..347001671 100644 --- a/pages/common/rg.md +++ b/pages/common/rg.md @@ -4,33 +4,33 @@ > Aims to be a faster alternative to `grep`. > More information: . -- Recursively search the current directory for a regex pattern: +- Recursively search the current directory for a regular expression: -`rg {{pattern}}` +`rg {{regular_expression}}` -- Search for pattern including all .gitignored and hidden files: +- Search for regular expressions including all .gitignored and hidden files: -`rg --no-ignore --hidden {{pattern}}` +`rg --no-ignore --hidden {{regular_expression}}` -- Search for a pattern only in a certain filetype (e.g., html, css, etc.): +- Search for a regular expression only in a certain filetype (e.g., html, css, etc.): -`rg --type {{filetype}} {{pattern}}` +`rg --type {{filetype}} {{regular_expression}}` -- Search for a pattern only in a subset of directories: +- Search for a regular expression only in a subset of directories: -`rg {{pattern}} {{set_of_subdirs}}` +`rg {{regular_expression}} {{set_of_subdirs}}` -- Search for a pattern in files matching a glob (e.g., `README.*`): +- Search for a regular expression in files matching a glob (e.g., `README.*`): -`rg {{pattern}} --glob {{glob}}` +`rg {{regular_expression}} --glob {{glob}}` - Only list matched files (useful when piping to other commands): -`rg --files-with-matches {{pattern}}` +`rg --files-with-matches {{regular_expression}}` -- Show lines that do not match the given pattern: +- Show lines that do not match the given regular expression: -`rg --invert-match {{pattern}}` +`rg --invert-match {{regular_expression}}` - Search a literal string pattern: diff --git a/pages/common/sd.md b/pages/common/sd.md index a27ef2e2c..01198d1d9 100644 --- a/pages/common/sd.md +++ b/pages/common/sd.md @@ -2,7 +2,7 @@ > Intuitive find & replace CLI. -- Trim some whitespace using regex: +- Trim some whitespace using a regular expression: `{{echo 'lorem ipsum 23 '}} | sd '\s+$' ''` diff --git a/pages/common/sed.md b/pages/common/sed.md index c2e284e11..6673f2b49 100644 --- a/pages/common/sed.md +++ b/pages/common/sed.md @@ -5,11 +5,11 @@ - Replace the first occurrence of a regular expression in each line of a file, and print the result: -`sed 's/{{regex}}/{{replace}}/' {{filename}}` +`sed 's/{{regular_expression}}/{{replace}}/' {{filename}}` - Replace all occurrences of an extended regular expression in a file, and print the result: -`sed -r 's/{{regex}}/{{replace}}/g' {{filename}}` +`sed -r 's/{{regular_expression}}/{{replace}}/g' {{filename}}` - Replace all occurrences of a string in a file, overwriting the file (i.e. in-place): diff --git a/pages/common/stow.md b/pages/common/stow.md index 5360ea94d..1cc5f9236 100644 --- a/pages/common/stow.md +++ b/pages/common/stow.md @@ -22,4 +22,4 @@ - Exclude files matching a regular expression: -`stow --ignore={{regex}} --target={{path/to/target_directory}} {{file1 directory1 file2 directory2}}` +`stow --ignore={{regular_expression}} --target={{path/to/target_directory}} {{file1 directory1 file2 directory2}}` diff --git a/pages/common/vim.md b/pages/common/vim.md index 08d9fdfc8..43fb40c78 100644 --- a/pages/common/vim.md +++ b/pages/common/vim.md @@ -28,9 +28,9 @@ `/{{search_pattern}}` -- Perform a regex substitution in the whole file: +- Perform a regular expression substitution in the whole file: -`:%s/{{pattern}}/{{replacement}}/g` +`:%s/{{regular_expression}}/{{replacement}}/g` - Display the line numbers: diff --git a/pages/common/z.md b/pages/common/z.md index badd1f2d3..ed5d4af1e 100644 --- a/pages/common/z.md +++ b/pages/common/z.md @@ -1,6 +1,6 @@ # z -> Tracks the most used (by frecency) directories and enables quickly navigating to them using string or regex patterns. +> Tracks the most used (by frecency) directories and enables quickly navigating to them using string patterns or regular expressions. > More information: . - Go to a directory that contains "foo" in the name: diff --git a/pages/common/zmv.md b/pages/common/zmv.md index 291ecf78b..06ac6a681 100644 --- a/pages/common/zmv.md +++ b/pages/common/zmv.md @@ -4,7 +4,7 @@ > See also `zcp` and `zln`. > More information: . -- Move files using a regex-like pattern: +- Move files using a regular expression-like pattern: `zmv '{{(*).log}}' '{{$1.txt}}'` diff --git a/pages/linux/apt-file.md b/pages/linux/apt-file.md index 27ac4167b..e26a283b9 100644 --- a/pages/linux/apt-file.md +++ b/pages/linux/apt-file.md @@ -17,4 +17,4 @@ - Search for packages that match the regular expresssion given in `pattern`: -`apt-file {{search|find}} --regexp {{pattern}}` +`apt-file {{search|find}} --regexp {{regular_expression}}` diff --git a/pages/linux/auracle.md b/pages/linux/auracle.md index 5f9cb22e1..406ff0bfd 100644 --- a/pages/linux/auracle.md +++ b/pages/linux/auracle.md @@ -5,7 +5,7 @@ - Display AUR packages that match a regular expression: -`auracle search '{{regex}}'` +`auracle search '{{regular_expression}}'` - Display package information for a space-separated list of AUR packages: diff --git a/pages/linux/csplit.md b/pages/linux/csplit.md index 3ccb8feaf..efa272c0a 100644 --- a/pages/linux/csplit.md +++ b/pages/linux/csplit.md @@ -22,4 +22,4 @@ - Split a file at a line matching a regular expression: -`csplit {{file}} /{{regex}}/` +`csplit {{file}} /{{regular_expression}}/` diff --git a/pages/linux/inotifywait.md b/pages/linux/inotifywait.md index 2931e07dc..9806afb06 100644 --- a/pages/linux/inotifywait.md +++ b/pages/linux/inotifywait.md @@ -16,7 +16,7 @@ - Exclude files matching a regular expression: -`while inotifywait --recursive {{path/to/directory}} --exlude '{{regex}}'; do {{command}}; done` +`while inotifywait --recursive {{path/to/directory}} --exlude '{{regular_expression}}'; do {{command}}; done` - Wait at most 30 seconds: diff --git a/pages/linux/pacman-files.md b/pages/linux/pacman-files.md index 0d019fa9f..fabecd516 100644 --- a/pages/linux/pacman-files.md +++ b/pages/linux/pacman-files.md @@ -18,7 +18,7 @@ - Find the package that owns a specific file, using a regular expression: -`pacman --files --regex '{{search_pattern}}'` +`pacman --files --regex '{{regular_expression}}'` - List only the package names: diff --git a/pages/linux/zgrep.md b/pages/linux/zgrep.md index 1d7a89918..72b5dee8e 100644 --- a/pages/linux/zgrep.md +++ b/pages/linux/zgrep.md @@ -24,7 +24,7 @@ - Use extended regular expressions (supporting `?`, `+`, `{}`, `()` and `|`): -`zgrep -E {{^regex$}} {{path/to/file}}` +`zgrep -E {{regular_expression}} {{path/to/file}}` - Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match: diff --git a/pages/osx/rename.md b/pages/osx/rename.md index 137430e8d..c52144323 100644 --- a/pages/osx/rename.md +++ b/pages/osx/rename.md @@ -1,6 +1,6 @@ # rename -> Rename a file or group of files with a regex. +> Rename a file or group of files with a regular expression. - Replace `from` with `to` in the filenames of the specified files: diff --git a/pages/osx/sed.md b/pages/osx/sed.md index c105554df..afd64610c 100644 --- a/pages/osx/sed.md +++ b/pages/osx/sed.md @@ -9,7 +9,7 @@ - Replace all occurrences of an extended regular expression in a file: -`sed -E 's/{{regex}}/{{replace}}/g' {{filename}}` +`sed -E 's/{{regular_expression}}/{{replace}}/g' {{filename}}` - Replace all occurrences of a string [i]n a file, overwriting the file (i.e. in-place):