When a large number of folder names contain random numbers, dates, serial numbers, or project codes, manually renaming them one by one is not only time-consuming but also prone to omissions or mistakes. This article uses HeSoft Doc Batch Tool as an example to demonstrate how to use wildcard regular expressions for batch fuzzy search, replacing the last three digits of multiple folder names with specified text to achieve standardized batch renaming. The article includes before-and-after effects, operation steps, expression writing ideas, and notes, suitable for office users who need to organize project directories, data archiving directories, order folders, or customer folders.
In daily office work, many folder names are not completely consistent. For example, a project folder might be named "INV4X812", "ORD7A293", or "PO9C376", where the first half is a project or client code, and the second half is a random number, serial number, or version number. If you only need to uniformly replace these variable numbers with the same text, manual modification one by one would be very inefficient. Especially when the number of folders reaches dozens or even hundreds, repetitive work significantly increases the risk of errors.
The problem this article aims to solve is: how to use the batch processing capabilities of office software, through wildcard regular expressions or formula-based fuzzy search, to batch-modify variable content in many folder names. In the example, we will uniformly replace the three-digit numbers at the end of multiple folder names with "-TEST", transforming folder names from "alphanumeric mixed codes" into more easily identifiable test directory names.
The following explanation uses the screenshot HeSoft Doc Batch Tool as an example. It is a batch document and file processing software for office scenarios, with its core value being the reduction of repetitive clicks and manual input. It is suitable for batch processing tasks like organizing files, folders, Word documents, Excel sheets, PDFs, and images. This article focuses on its "Folder Name" batch replacement function.
Applicable Scenarios: Which Folder Names Are Suitable for Batch Modification Using Wildcard Regular Expressions
The advantage of wildcard regular expressions lies in "fuzzy matching". This method is very suitable when the content you want to modify is not a fixed character string, but content with a certain pattern of variation. For example, every folder name contains different three-digit numbers, dates, codes, version numbers, or serial numbers. It's difficult for a human to select them all at once, but an expression can identify them uniformly based on a rule.
Common applicable scenarios include:
- Batch replacing folder end numbers: For example, the three-digit numbers in "ClientA001, ClientB002, ClientC003" need to be uniformly replaced with "Archive".
- Batch processing project directories: For example, project folders containing random test codes need to be uniformly changed to formats like "ProjectName-TEST" or "ProjectName-Final".
- Organizing order or contract documents: Order and contract folder names often contain different sequence numbers, which can be uniformly deleted or replaced using expressions.
- Standardizing department shared drive directories: When naming conventions for folders created by multiple people are inconsistent, you can batch-replace certain variable fields to reduce manual organization.
- Batch processing migrated document directories: Folders exported from a system often have random suffixes, which can be quickly cleaned up using regular expressions.
Compared to ordinary "find and replace", wildcard regular expressions don't just look for one fixed word, but can find "a category of text that conforms to a certain rule". In this article's example, the numbers at the end of folder names—"812, 293, 376, 194, 705"—are all different, but they all share the rule of being "three consecutive digits", thus allowing them to be matched uniformly with an expression.
Preview of Results: Folder Name Changes Before and After Processing
Before the formal operation, let's first look at the before-and-after effect of this batch folder name modification. This allows for a more intuitive understanding of the role of wildcard regular expressions in batch renaming.
Before Processing: Multiple Folder Names Containing Different Three-Digit Numbers
The folder names before processing are shown in the image below. You can see that the first half of each folder name is a mix of alphanumeric codes, and the end has three digits, but the digits are different for each folder. Examples include "INV4X812", "ORD7A293", "PO9C376", "REQ8F194", "SO2D705".

If you used a standard fixed-text search, for instance, only looking for "812", you would only modify the first folder. Searching for "293", "376", "194", "705" one by one returns you to the inefficient manual method. This is a perfect time to use wildcard regular expressions to directly match "three consecutive digits".
After Processing: The Final Three Digits Are Uniformly Replaced with -TEST
The folder names after processing are shown in the image below. The original trailing three-digit numbers have been uniformly replaced with "-TEST", resulting in final names like "INV4X-TEST", "ORD7A-TEST", "PO9C-TEST", "REQ8F-TEST", and "SO2D-TEST".

From the result, you can see that the software did not simply replace a single specific number. Instead, it found the numerical part matching the condition in each folder name based on the expression rule and uniformly replaced it with the specified content. This is exactly the core value of batch fuzzy modification of folder names.
Operation Steps: Using HeSoft Doc Batch Tool to Batch Replace Keywords in Folder Names
Following the sequence of operations in the screenshot, here is how to complete this batch modification. The entire process can be summarized as: enter the Folder Name tool, select "Find and Replace Keywords in Folder Names", add the folders to be processed, set the formula-based fuzzy text search, input the matching rule and replacement content, and then proceed to the next step to finish processing.
Step 1: Enter the "Folder Name" Tool Category
After opening HeSoft Doc Batch Tool , you can see multiple office processing categories on the left, such as "File Name", "Folder Name", "File Organization", "Word Tools", "Excel Tools", "PowerPoint Tools", and "PDF Tools", etc. Since we want to modify folder names this time, not file names or document content, we need to select the "Folder Name" category on the left.
On the "Folder Name" page, you can see multiple function cards related to folder naming, including "Find and Replace Keywords in Folder Names", "Insert Text into Folder Name", "Add Prefix and Suffix to Folder Name", "Convert Folder Name Case", "Delete Text from Folder Name", etc. This time's requirement is to replace a certain type of variable characters in folder names with specified text, so we should choose "Find and Replace Keywords in Folder Names".

The operational goal of this step is to enter the correct batch processing module. We choose "Find and Replace" instead of "Add Prefix and Suffix" or "Delete Text" because we need to both find a segment of content in the original name and replace it with new text.
Step 2: Add the Folders to be Processed in Batch
After entering the "Find and Replace Keywords in Folder Names" function, the top of the interface shows a step-by-step process: Select records to process, Set processing options, Set save location, Start processing. The first step is to add the folders to be processed.
In the screenshot, there is an "Add Folder" button at the top right. Clicking it allows you to add the folders that need batch renaming to the list. After adding, the list will display information like serial number, name, path, creation time, modification time, and operations. The example has already added 5 folders, with paths located in the D:\test\ directory.

The expected result after adding folders is: all folders to be processed appear in the list, and the name column displays their current names. You can check at this step whether the correct directories have been added. If a folder does not need processing, you can remove it through the operation entry on the right side of the list; if the list is too large, you can also use the "Filter" and "Sort" buttons on the interface to assist viewing.
This step is important because batch renaming will act on all records in the list at once. Before setting the expression, it is recommended to confirm that the number of folders, paths, and names meet expectations to avoid processing unrelated directories.
Step 3: Enter Processing Options, Select "Use Formula to Fuzzy Find Text"
After confirming the folders to be processed, click "Next" at the bottom of the interface to enter the second step, "Set processing options". Here you can set the search method, additional options, the list of keywords to find, and the list of replacement keywords.
In the screenshot, you can see that the "Search method" offers two options: "Exact Text Search" and "Use Formula to Fuzzy Find Text". This time, we are looking for different three-digit numbers in each folder name, so we should choose "Use Formula to Fuzzy Find Text". This option is suitable for handling variable text, which is the wildcard regular expression or fuzzy formula matching scenario discussed in this article.

If "Exact Text Search" were chosen, it would usually be suitable for finding completely identical content, like if all folders contained the word "Temp" which needed to be uniformly replaced with "Archive". But in this example, the ending digits (812, 293, 376, 194, 705) are not identical, so fuzzy search is required.
Step 4: Fill in the Keyword Expression to Find
In the "List of keywords to find", the example fills in:
\d{3}This expression can be understood as matching "three consecutive digits". Here, \d represents a digit, and {3} represents that the preceding element appears 3 consecutive times. Therefore, it can match content like "812", "293", "376", "194", "705".
In folder batch renaming scenarios, the expression should be filled in to match the actual pattern as closely as possible. If the end of your folder names has two digits, you might consider matching two digits; for a four-digit year or sequence number, you can adjust the length according to the actual rule. This article's example only demonstrates the replacement of three digits from the screenshot, and arbitrarily expanding the matching scope without understanding the rules is not recommended.
Note that the expression will match content in the folder name based on the rule. If there are also three consecutive digits in the middle of the folder name, and you only want to process the digits at the end, you need to design the expression more carefully in practice to avoid matching parts that shouldn't be changed. The folder name structure in this article's screenshot is relatively clear, and the final three digits are the target content.
Step 5: Fill in the Replacement Keyword
In the "List of replacement keywords" on the right, the example fills in:
-TESTThis means the three-digit numbers matched by the expression on the left will be replaced with "-TEST". Thus, "INV4X812" becomes "INV4X-TEST", and "ORD7A293" becomes "ORD7A-TEST".
From a naming convention perspective, the replacement content can be set flexibly according to your business scenario. For example, test directories might use "-TEST", archive directories might use "-ARCHIVE", version directories might use "-V2", and internal projects could also use Chinese identifiers. However, during batch processing, it is recommended to use concise, uniform, and easily recognizable naming rules to facilitate subsequent searching and sorting.
Step 6: Proceed to the Next Step and Complete Processing According to the Interface Flow
After setting the search expression and replacement content, you can click "Next" at the bottom. According to the interface flow, subsequent steps will involve "Set save location" and "Start processing". Since the screenshot shows the process up to the "Set processing options" stage, you just need to continue confirming by following the software interface prompts.
Before actually starting processing, it is recommended to double-check the following three points: first, is the list of folders to process correct? Second, is the search method set to "Use Formula to Fuzzy Find Text"? Third, are the left expression and right replacement text filled in correctly? Starting processing only after confirming these is correct can effectively reduce the risk of batch renaming.
Thought Process Behind the Wildcard Regular Expression: Why Use \d{3}
When many users first encounter wildcard regular expressions, they find them somewhat abstract. In fact, for batch folder renaming, you just need to understand "describing the text to find using a rule".
The goal in this example is to replace the three-digit numbers at the end of folder names. Although each number is different, they share a commonality: they are all three consecutive digits. Therefore, you can use \d{3} to represent this category of content.
If you break down this idea, it can be understood as follows:
- \d: Represents any single digit, from 0 to 9.
- {3}: Represents that the preceding content appears 3 consecutive times.
- \d{3}: Combined, this means any three consecutive digits.
This method is much more efficient than entering "812, 293, 376, 194, 705" one by one. Especially when facing a large number of folders, as long as the naming pattern is consistent, you can use a single expression to complete the batch find and replace.
Of course, the broader the expression, the larger the matching range. In office scenarios, it is advisable to first test with a small number of folders to confirm the results are as expected before executing the batch operation on a large number of official directories. If the directory names are very complex, you can also copy the sample folders to a test directory first, verify the rules, and then apply them to the official data.
Common Questions and Considerations
1. Is this method suitable for modifying file names?
This article demonstrates the function under the "Folder Name" category, where the processing object is folders. If you want to modify the file names of doc, docx, xls, xlsx, ppt, pptx, pdf, jpg, or other files, you should switch to the corresponding "File Name" related functions, rather than operating in the Folder Name module. The entry point should be clearly distinguished based on the processing object.
2. Why not use Exact Text Search?
Exact search is suitable when all names contain the same fixed string of text. For example, if all folders contain "Old_Version" and you want to replace it with "New_Version". In this example, the end numbers for each folder are different, so a fixed search cannot cover them all at once, making "Use Formula to Fuzzy Find Text" a more appropriate choice.
3. Will the expression mistakenly modify other numbers?
It is possible. As long as content matching the expression exists in the folder name, it could be matched. Therefore, in actual operation, rules must be set carefully according to the naming structure. If a folder name has multiple groups of three consecutive digits and you only want to replace one, you need to further limit the matching conditions. The name structure in the screenshot example is relatively uniform, so using \d{3} can achieve the expected effect.
4. Do I need a backup before batch processing?
It is recommended to back up important data first, or do a trial run in a test directory beforehand. While batch renaming can significantly improve efficiency, a poorly set rule can also generate names that don't meet expectations in bulk. For critical data like department shared drives, project archive directories, and contract databases, backup and preliminary checks are very necessary.
5. Should the names remain unique after replacement?
Folder names in the same directory usually cannot be duplicated. Therefore, when designing the replacement rule, you must ensure that it doesn't generate multiple completely identical names. In this example, the first half of the code is retained, and only the final three digits are replaced, so the results still maintain distinction—for instance, "INV4X-TEST" and "ORD7A-TEST" are not in conflict.
Summary: Using Batch Processing Tools to Reduce Repetitive Folder Renaming Labor
When folder names contain a large number of variable codes, manual renaming is not only slow but also prone to omissions. Using the "Find and Replace Keywords in Folder Names" function in HeSoft Doc Batch Tool , you can batch-identify content matching a rule via "Use Formula to Fuzzy Find Text" and then uniformly replace it with specified text.
This article's example used \d{3} to match three consecutive digits and replaced them with "-TEST", achieving a batch conversion from "INV4X812" to "INV4X-TEST". This approach is equally applicable to many office document organization scenarios, such as batch processing project directories, client folders, order folders, test data directories, etc.
If you frequently need to organize large numbers of folders, it is recommended to add this wildcard regular expression batch renaming method to your daily office workflow. First, confirm the naming pattern, then add the folders, set the fuzzy search rule and replacement text, and finally execute the process by following the interface flow. This compresses the repetitive task of modifying items one by one into just a few minutes of work.