mirror of
https://github.com/tldr-pages/tldr.git
synced 2026-08-29 04:21:03 +08:00
fastmod, perl: enclose regex in backticks (#20528)
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
# fastmod
|
||||
|
||||
> أداة للاستبدال الجزئي للنصوص في قاعدة الأكواد لديك.
|
||||
> التعبيرات النمطية يعالجها قفص من بضاعة رست وهو regex.
|
||||
> التعبيرات النمطية يعالجها قفص من بضاعة رست وهو `regex`.
|
||||
> لمزيد من التفاصيل: <https://github.com/facebookincubator/fastmod>.
|
||||
|
||||
- استبدال بالتعبيرات النمطية في كل ملفات المسار الحالي وأبنائه في الملفات غير المُتجاهلة بـ `.ignore` أو `.gitignore`:
|
||||
|
||||
`fastmod {{regex_pattern}} {{replacement}}`
|
||||
`fastmod {{regex}} {{replacement}}`
|
||||
|
||||
- استبدال متجاهلا حالة الحرف في ملف أو في ملفات مسار:
|
||||
|
||||
`fastmod --ignore-case {{regex_pattern}} {{replacement}} -- {{path/to/file path/to/directory ...}}`
|
||||
`fastmod --ignore-case {{regex}} {{replacement}} -- {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
|
||||
- استبدال بالتعبيرات النمطية مع تحديد المكان الذي يُستبدل فيه:
|
||||
|
||||
`fastmod {{regex}} {{replacement}} --dir {{path/to/directory}} --iglob {{'**/*.{js,json}'}}`
|
||||
`fastmod {{regex}} {{replacement}} --dir {{path/to/directory}} --iglob '{{**/*.{js,json}}}'`
|
||||
|
||||
- استبدال بالنص مُطابقةً (وليس التعبيرات النمطية)، في ملفات امتداداتهم إما js أو JSON فحسب:
|
||||
|
||||
|
||||
@@ -32,6 +32,6 @@
|
||||
|
||||
`perl -p0e 's/{{recherche}}/{{remplacement}}/g' {{fichier_entrée}} > {{fichier_sortie}}`
|
||||
|
||||
- Lancer une expression régulière (RegEx) sur `stdin`, en affichant le premier groupe capturé pour chaque ligne :
|
||||
- Lancer une expression régulière (`regex`) sur `stdin`, en affichant le premier groupe capturé pour chaque ligne :
|
||||
|
||||
`cat {{fichier_entrée}} | perl -nle 'if (/{{regex}}/) { print "$1"; last;}'`
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# fastmod
|
||||
|
||||
> A fast partial replacement for the codemod tool, replace and replace all in the whole codebase.
|
||||
> Regexes are matched by Rust regex crate.
|
||||
> Regexes are matched by Rust `regex` crate.
|
||||
> More information: <https://github.com/facebookincubator/fastmod>.
|
||||
|
||||
- Replace a `regex` in all files of the current directory, ignoring files on `.ignore` and `.gitignore`:
|
||||
|
||||
Reference in New Issue
Block a user