fastmod, perl: enclose regex in backticks (#20528)

This commit is contained in:
Sebastiaan Speck
2026-01-04 03:43:08 +01:00
committed by GitHub
parent 51db8b3168
commit 97fc587ea8
3 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -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 فحسب:
+1 -1
View File
@@ -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 -1
View File
@@ -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`: