- Create a file with name "12345".
- Click the file in Total Commander and start the Multi-Rename Tool (Ctrl+M).
- I want to add dashes around all digits, so I search for regular expression "(?:)" which means zero-length string and replace with "-"
Code: Select all
Filename: 12345
Search for: (?:)
Replace with: -
1x: Disabled
Subst: Disabled
Result: -1-2-3-4-5
Expected result: -1-2-3-4-5-
On https://regex101.com/ you can see that 7 different flavors of regular expressions do match the position at the end.
Just fill in the following data and click the different flavors.
Code: Select all
REGULAR EXPRESSION: (?:)
TEST STRING: 12345
Another example:
- Create a file with name "1234_text_ABCD".
- Click the file in Total Commander and start the Multi-Rename Tool (Ctrl+M).
- I want to add two underscores around all chars and remove the text in between underscores in the original filename
Code: Select all
Filename: 1234_text_ABCD
Search for: (_[a-zA-Z]+_)?
Replace with: __
1x: Disabled
Subst: Disabled
Result: __1__2__3__4____A__B__C__D
Expected result: __1__2__3__4____A__B__C__D__
P.S. In older versions of Total Commander this problem doesn't occur. (?:) isn't supported in older versions, but A{0} and examples with ()? do work.