1.2 KiB
1.2 KiB
Quickstart – Regex Command
-
Preview a capture-group rename before applying.
renamer regex '^(\d{4})-(\d{2})_(.*)$' 'Q@2-@1_@3' --dry-run- Converts
2025-01_report.txtintoQ01-2025_report.txtin preview mode. - Skipped files remain untouched and are labeled in the preview table.
- Converts
-
Limit scope with extension and directory flags.
renamer regex '^(build)_(\d+)_v(.*)$' 'release-@2-@1-v@3' --path ./artifacts --extensions .zip|.tar.gz --include-dirs --dry-run- Applies only to archives under
./artifacts, including subdirectories when paired with-r. - Hidden files remain excluded unless
--hiddenis added.
- Applies only to archives under
-
Apply changes non-interactively for automation.
renamer regex '^(feature)-(.*)$' '@2-@1' --yes --path ./staging--yesconfirms using the preview plan and writes a ledger entry containing pattern and template metadata.- Exit code
0indicates success; non-zero signals validation or conflict issues.
-
Undo the last regex batch if results are unexpected.
renamer undo --path ./staging- Restores original filenames using the
.renamerledger captured during apply.
- Restores original filenames using the