When many folder names contain unnecessary numbers, serial numbers, or fixed-format suffixes, renaming them one by one is not only time-consuming but also prone to omissions. This article uses removing the three-digit suffix from folder names as an example to introduce how to use formulas for fuzzy matching in HeSoft Doc Batch Tool , that is, the regular expression method, to batch match and delete specified content in folder names. By adding folders, setting search rules, leaving the replacement content blank, and other steps, names like INV4X812 and ORD7A293 can be cleaned up to INV4X and ORD7A in one go.
In daily office work, file archiving, project delivery, and client document organization, you often encounter a batch of folder names with random numbers, serial numbers, batch numbers, or suffixes exported from systems. For example, folder names like INV4X812, ORD7A293, PO9C376, REQ8F194, SO2D705, where the actual business code at the front needs to be retained, while the three-digit number at the end is just a temporary identifier. If you delete these numbers manually one by one, it is not only repetitive labor but also prone to errors and omissions. The problem this article aims to solve is: How to use the fuzzy matching capabilities of wildcards or regular expressions to batch delete keywords or number segments from multiple folder names.
The office software used here is HeSoft Doc Batch Tool . As can be seen from the interface, it is positioned for batch processing of documents and files, with categories on the left including File Name, Folder Name, File Organizer, Word Tools, Excel Tools, PowerPoint Tools, PDF Tools, etc. This article will demonstrate the Folder Name feature with screenshots, focusing on how to find and replace keywords in folder names, replacing the matched content with nothing to achieve batch deletion.
Applicable Scenarios: Which Folder Names Are Suitable for Batch Deletion Using Regular Expressions
If you only need to modify one or two folders, manual renaming is sufficient. However, when the number of folders reaches dozens, hundreds, or even more, the value of a batch processing tool becomes very apparent. The following scenarios, in particular, are very suitable for fuzzy deletion using regular expressions or wildcards.
First, folder names containing fixed-length random numbers. For example, client data directories exported from business systems, where the first part of the name is the client code, automatically followed by three or four digits. Second, folder names containing identifiable fixed keywords, such as temp, backup, old version, to-be-deleted, test, etc., which need to be removed uniformly. Third, a certain segment in the folder names is not exactly the same but follows a certain pattern, like consecutive numbers, dates inside parentheses, or numbers after an underscore. Fourth, when organizing directories for Word, doc, docx, Excel, xlsx, PDF, and other materials, the naming of the folders themselves needs to be standardized first; otherwise, subsequent searching, archiving, and delivery will become chaotic.
In the example of this article, the processing goal is very clear: retain the alphanumeric combination at the front of each folder name and delete the last three consecutive digits. This requirement is difficult to fulfill with a standard exact search in one go, because the last three digits are different for each folder. But using the regular expression \d{3} allows you to fuzzily match any three consecutive digits, and by leaving the replacement content empty, you can achieve batch deletion.
Effect Preview: What Changes Occur in Folder Names Before and After Processing
Before Processing: Folder Names Have Unnecessary Three-Digit Suffixes
From the pre-processing screenshot, it can be seen that the folder list includes names like INV4X812, ORD7A293, PO9C376, REQ8F194, SO2D705. The areas marked in red are the last three digits that need to be deleted. Although these numbers are different, they share a common characteristic: they are all three consecutive digits.

If renamed one by one, you would need to open the folder list, select a folder, press F2 or right-click to rename, and then delete the trailing digits. Doing this five times might be acceptable, but for five hundred folders, manual operation becomes a significant waste of time, and it is very easy to accidentally delete the preceding business codes by misreading the numbers.
After Processing: Trailing Numbers Are Uniformly Deleted, Names Are Cleaner
The post-processing screenshot shows that the original INV4X812 became INV4X, ORD7A293 became ORD7A, PO9C376 became PO9C, REQ8F194 became REQ8F, and SO2D705 became SO2D. This means that the software only deleted the three digits matching the rule, preserving the valid part at the front of the folder name.

The key to this method is not deleting a specific fixed number but matching a category of content through rules. As long as the text to be deleted in the folder names follows the same pattern, it can be processed in batch. For office scenarios, this significantly reduces repetitive work, making tasks like material organization, project directory standardization, and name cleaning before archiving more efficient.
Operation Steps: Using HeSoft Doc Batch Tool to Batch Delete Keywords from Folder Names
Step 1: Enter the Folder Name Feature and Select "Find and replace keywords in folder names"
After opening HeSoft Doc Batch Tool , select Folder Name in the left function area. The main interface will display multiple function cards related to folder names, including Find and replace keywords in folder names, Insert text into folder name, Add prefix and suffix to folder name, Folder name case conversion, Delete text from folder name, etc.
In this example, the content we need to delete is not a fixed piece of text, but the different three-digit number at the end of each folder. The selected option in the screenshot is Find and replace keywords in folder names. This feature is suitable for first finding the target text and then replacing it with new text; if the replacement text is left blank, it effectively deletes the matched content.

The purpose of choosing this feature is to enter the batch find and replace workflow, rather than just adding a prefix, suffix, or converting the case of folder names. The expected result is to enter a step-by-step wizard page where you can subsequently add the folders to be processed and set the search rules.
Step 2: Add Folders to Be Processed and Confirm the List Records
After entering the function page, you can see buttons like Add Folder, Clear, and More at the top of the interface. As shown in the screenshot, click Add Folder to add the folders whose names need to be processed to the list. After addition, the table will display the sequence number, name, path, creation time, modification time, and operation column.

In the example, 5 records have been added, located in the D drive test directory, with names INV4X812, ORD7A293, PO9C376, REQ8F194, and SO2D705. It is recommended to check the list before proceeding to the next step to confirm that the added items are the folders you want to process, not parent directories or unrelated directories. The record count in the table helps you quickly verify the quantity and avoid omissions.
The purpose of this page is to hand over the objects to be processed to the software. The subsequent rules will only take effect on the folders present in the list. After confirming everything is correct, click Next at the bottom to enter the processing options setting.
Step 3: Choose to Use Formula for Fuzzy Text Search
On the processing options setup page, you first need to choose a search method. The screenshot shows two options: Exact text search, Use formula for fuzzy text search. In this example, we need to delete different three-digit numbers, which cannot be done with an exact search for a specific fixed value, so you should select Use formula for fuzzy text search.

The "formula for fuzzy text search" here can be understood as using wildcard or regular expression rules to describe the content to be searched for. Its advantage is that it does not require the text in each folder to be exactly the same; it can be found as long as it conforms to the rule. For tasks like batch deleting numbers, serial numbers, dates, content in parentheses, etc., this method is more flexible than standard search.
Step 4: Enter the Regular Expression in the Keyword List to Find
In the Keyword list to find, enter \d{3}. Here, \d represents a digit, and {3} means it appears consecutively 3 times. Therefore, \d{3} can match any three consecutive digits. For example, 812, 293, 376, 194, and 705 will all be matched.
If your folder names have four-digit numbers to delete, you can change the rule to \d{4}; if it's for a variable number of consecutive digits, you can usually use a broader digit matching rule based on the actual situation. However, before formal processing, it is advisable to make the rule as precise as possible. Because the broader the rule, the higher the risk of accidentally deleting other numeric content.
The purpose of using \d{3} in this example is to process only the three-digit numbers, not to delete all numbers in the folder name. For instance, REQ8F194 contains a digit 8 in the middle and 194 at the end. If the rule were written to match any digit, the 8 might also be deleted. The result in the screenshot retained REQ8F, removing only the 194 at the end, showing that rule settings should closely match real requirements.
Step 5: Leave the Replacement Keyword List Blank to Achieve Deletion
The area on the right is the Replaced keyword list, and the screenshot prompts If not filled in, it indicates deletion. Therefore, if the goal is to delete the matched three-digit numbers, you do not need to enter anything in the right area; keep it empty.
This setting is very critical. The logic of find and replace is: first find the text matched by the left rule, then replace it with the content filled in on the right. When the right side is empty, the replacement result is empty text, meaning the found content is removed from the folder name. This enables effects like batch deleting folder name keywords, batch deleting serial numbers, and batch deleting trailing digits.
Step 6: Proceed to Subsequent Steps to Set Save Location and Start Processing
The progress bar in the screenshot shows that the software uses a step-by-step process: Select records to process, Set processing options, Set save location, Start processing. After completing the search method and keyword rule settings, click Next at the bottom, continue to set the save location following the on-screen prompts, and then enter the start processing step.
As batch renaming directly affects folder names, it is recommended to confirm two things before processing: first, whether the rule only matches the content to be deleted; second, whether the folder list is correct. Execute the process after confirmation. After completion, you can go back to File Explorer to view the results. The folder names should be consistent with the post-processing screenshot, with the last three digits having been batch deleted.
Regular Expression Explanation: Why \d{3} Enables Fuzzy Deletion
Many users might find regular expressions complex upon hearing the term, but in this scenario, you only need to understand one simple rule. \d represents a digit character, i.e., 0 to 9; {3} means the preceding element is repeated three times. Therefore, \d{3} represents three consecutive digits.
In the example folder name INV4X812, 812 is three consecutive digits and will be matched; in ORD7A293, 293 will be matched; in PO9C376, 376 will be matched. After the software replaces these matched contents with nothing, the folder names naturally become INV4X, ORD7A, PO9C.
If your name structure is more complex, such as ProjectA_20260508, ClientData-001, ContractScanBackup2024, you can also design rules based on the actual pattern. But the principle remains the same: first identify a describable pattern, then use fuzzy search to match it, and finally leave the replacement content empty to complete the deletion.
Common Questions and Precautions
1. Why not use Exact Text Search
Exact search is suitable for deleting completely identical text. For example, if all folders contain the word "old", you can search exactly for "old" and replace it with nothing. But in this example, the trailing digits are different for each folder. An exact search cannot cover all cases in one go, so you need to use formula for fuzzy text search.
2. Why is the Replacement Keyword List Left Empty
Because the goal this time is deletion, not replacement with other characters. When the right side is left empty, the software replaces the matched content with nothing, which is equivalent to removing that segment of text from the folder name. If you enter other content on the right, such as "A", all matched three-digit numbers will be replaced with "A".
3. Is a Backup Necessary Before Batch Processing
It is recommended to back up important data first, or to test the rule with a small number of folders. Regular expressions are highly efficient, but an overly broad rule may affect names that should not be modified. Especially when folder names have multiple digit segments, confirm that the matching rule aligns with expectations.
4. Can It Be Used to Batch Organize Directories of Word, docx, Excel, PDF Materials
Yes. What is processed here are folder names, and the folders can contain office files like Word, doc, docx, Excel, xlsx, PPT, PDF, etc. Standardizing the directory names first makes file archiving, searching, or delivery much easier to manage later.
Summary: Use Rules to Replace Manual Work and Quickly Clean Folder Names
Batch deleting keywords from folder names is essentially handing over repetitive renaming actions to office software. Using the Folder Name feature of HeSoft Doc Batch Tool , select "Find and replace keywords in folder names", then use formula for fuzzy text search to enter \d{3}, and leave the replacement content empty to delete the three-digit numbers from multiple folder names at once.
This method is suitable for processing random numbers, system suffixes, batch numbers, temporary marks, and other regular but not identical text. Compared to manually renaming one by one, batch processing can save a significant amount of time and reduce the risk of omissions and errors. If you are organizing a large number of project folders, client data directories, or office document archive directories, you can start by testing the rules on a small sample, confirm the effect, and then execute in batch.