When multiple Word or docx documents contain different but patterned sensitive words, numbers, abbreviations, or digits, opening each file to search and delete them one by one is time-consuming and prone to omissions. This article uses HeSoft Doc Batch Tool as an example to demonstrate how to use the "Find and Replace Keywords in Word" feature, leveraging regular expressions to perform fuzzy matching across multiple documents and leaving the replacement result blank, thereby achieving batch deletion of keywords. The article includes before-and-after comparisons, step-by-step instructions, and notes, making it suitable for office scenarios that require batch cleanup of Word document content.
In daily office work, many people encounter this situation: a folder contains dozens or even hundreds of Word documents, and each document contains some content that needs to be deleted, such as English abbreviations, course codes, serial numbers, years, phone numbers, monetary amounts, unified prefixes, etc. This content is not necessarily identical, but often follows certain patterns. If you open docx files one by one and repeatedly use Word's built-in find and replace function, it is not only time-consuming but also easy to miss deletions.
The problem this article aims to solve is: How to use regular expressions to batch delete keywords in multiple Word documents in a fuzzy manner. The office software used here is HeSoft Doc Batch Tool , as shown in the screenshot. It is positioned as a batch file processing tool for office scenarios, with its core value being processing multiple files at once, reducing repetitive work, and improving efficiency.
As seen in the screenshot, there are 6 docx files in this example. Before processing, the documents contained content like BOT, ELA, and 60; after processing, these characters matching the rules were batch deleted. The following will combine the screenshots to fully explain the applicable scenarios, effect preview, specific operation steps, and issues to note when using regular expressions.
Applicable Scenarios: Which Word Content is Suitable for Batch Deletion Using Regular Expressions
Regular expressions are suitable for processing text where "the content is not exactly the same, but the format has a pattern." Compared to ordinary exact searches, regular expressions don't just look for a specific fixed word but match a category of content through rules, making them particularly suitable for batch cleaning up fuzzy keywords in Word, docx, and doc documents.
For example, the following situations can all consider using regular expressions for batch deletion:
- Deleting fixed-format numbers in Word documents, such as 001, 002, 2026, A123, etc.;
- Deleting English uppercase abbreviations, such as BOT, ELA, ABC, and other three-letter uppercase words;
- Deleting consecutive numbers in documents, such as 60, 100, 2026, etc.;
- Deleting course codes, department codes, project numbers in batch template documents;
- Cleaning up placeholders, invalid markers, or rule-based text generated after system import in multiple docx files.
In this example, two regular rules were used: [A-Z]{3} and \d+. The former means matching three consecutive uppercase English letters, and the latter means matching consecutive digits. That is, as long as text matching these rules appears in the Word content, it can be uniformly found and deleted.
Effect Preview: Changes in Word Content Before and After Processing
Before Processing: Multiple docx files require unified cleanup
Before processing, the folder contained 6 Word files from 1.docx to 6.docx. For such batch tasks, manual processing would require opening, searching, and saving each file individually. The more files, the more obvious the repetitive operation becomes.

Upon opening one of the Word documents, you could see the content that needed to be deleted in the main text. The screenshot highlights the example locations with red arrows, such as BOT at the beginning of the title, and ELA and 60 in the main body. While these are not the same fixed word, they all follow certain patterns: BOT and ELA are three uppercase letters, and 60 is a consecutive number.

After Processing: Content matching the rules is batch deleted
After processing is complete, upon reopening the Word document, you can see that the original BOT in the title has disappeared, and ELA and 60 in the main text have also been deleted. Since the "Replaced keyword list" for this operation was empty, the software replaced the matched content with nothing, effectively performing a batch deletion.

From the results perspective, this method is very suitable for processing a large number of Word documents with relatively clear rules. As long as the rules are set accurately, you can complete the cleanup of multiple documents at once without repeatedly opening each file.
Operation Steps: Using Regular Expressions for Fuzzy Batch Deletion of Word Keywords
Step 1: Enter Word Tools and select "Find and Replace Keywords in Word"
After opening HeSoft Doc Batch Tool , select Word Tools in the left navigation bar. In the list of Word tools, find and click "Find and Replace Keywords in Word". As seen in the screenshot, the function's description is "Batch find and replace keywords in Word file content," which is perfectly suited for the task of batch deleting keywords here.

The purpose of this step is to enter the functional module specifically designed for processing find and replace in Word content. It's important to note that although this is "deleting keywords", within the software logic it still belongs to "Find and Replace": leaving the replacement content empty achieves the deletion effect.
Step 2: Add the Word files to be processed
After entering the function page, the first step is to "select the records to process". The top right area of the interface provides two entry points: Add File and Import Files from Folder. For a small number of files, you can click "Add File"; if you need to process multiple Word documents in a folder, using "Import Files from Folder" is more convenient.

The screenshot shows that 6 docx files have been imported, and the table lists the file names, paths, extensions, creation times, and modification times. After confirming the file list is correct, click Next at the bottom to proceed to processing option settings.
The expected result of this step is that all Word files needing batch keyword deletion appear in the list. If you find that unnecessary files were imported, you can remove them using the operation buttons on the right side of the list to avoid accidental processing.
Step 3: Select "Use formula for fuzzy text search"
After entering "Set Processing Options", in the "Search Method" area, select Use formula for fuzzy text search. As seen in the screenshot, this option is already selected. The "formula fuzzy search" here can be understood as searching according to rules, meaning using a method similar to regular expressions to match text.

If you were only deleting a fixed word, for example, only deleting the word "test", you could use the exact text search. However, this example aims to delete a category of content: three uppercase letters and consecutive numbers, thus requiring fuzzy rules.
Step 4: Enter regular rules in the "Keywords to Find" list
In the "Keywords to Find" list, enter the matching rules line by line. The screenshot shows two lines entered:
- [A-Z]{3}: Matches three consecutive uppercase English letters, e.g., BOT, ELA;
- \d+: Matches one or more consecutive digits, e.g., 60.
Each line can be understood as a search rule. The software will search the imported Word files for text that matches the rules in the list. Since these rules cover a certain range, they can achieve a "fuzzy deletion" effect.
In practice, it is recommended to test the rules on a small number of files first to ensure accuracy. For instance, [A-Z]{3} will match all three-letter uppercase sequences; if the document contains other three-letter abbreviations that should not be deleted, they might also be deleted. Therefore, the more precise the regular expression, the safer the batch processing.
Step 5: Keep the "Replaced Keywords" list empty
The area on the right is the "Replaced Keywords" list. The screenshot shows a prompt: Leave blank to indicate deletion. Therefore, if the goal is to delete the matched content, you do not need to enter any replacement text on the right; keep it empty.
This step is crucial. If content is filled in on the right, the software will replace the matched text with what you entered; if left empty, the matched text will be deleted. The goal of this article is to batch delete keywords in Word, so the right side stays empty.
Step 6: Click Next, set the save location, and start processing
After completing the search rules and replacement content settings, click Next. The workflow at the top of the interface shows that subsequent steps include "Set Save Location" and "Start Processing". Proceed according to the software's workflow by setting the output location and launching the process.
When batch processing Word files, it is recommended to save the processed files to a new folder to distinguish them from the original files. This way, even if the regular rule settings are not as expected, you can keep the original files and easily reprocess after adjusting the rules.
Common Questions and Precautions
1. Why does leaving the replacement list empty delete content?
The essence of find and replace is "find the target text, then replace it with the specified content." When the replacement content is empty, it equates to replacing the target text with null, thus appearing as deletion. The prompt in the screenshot, "Leave blank to indicate deletion," explicitly explains this point.
2. Could regular expressions accidentally delete other content?
It's possible. The matching scope of a regular expression depends on the rule itself. For example, \d+ will match all consecutive digits; if the document contains page numbers, years, amounts, or serial numbers, these might also be matched. Therefore, before official batch processing, it is recommended to test with 1 or 2 files first, confirm the effect, and then process all documents.
3. Can I delete content matching multiple different rules simultaneously?
Yes. As seen in the screenshot, the "Keywords to Find" list supports multi-line input. In this example, two rules, [A-Z]{3} and \d+, were entered simultaneously to match uppercase letter abbreviations and numbers respectively.
4. Can both doc and docx be processed this way?
The sample files in the screenshot have the docx extension. For batch processing Word documents, it is recommended to prioritize using docx files for the operation. If you have older doc files, you can test a small batch first to confirm the software's processing results for that format meet expectations before proceeding with the batch task.
5. Is a backup necessary before batch deletion?
Backup is advised. Especially when using regular expressions for fuzzy matching, if the rules are too broad, they might delete content that shouldn't be deleted. Saving the processing results to a new directory, or making a copy of the original files beforehand, is a more prudent approach.
Summary: Using Batch Processing Tools to Reduce Repetitive Word Cleanup Work
Using regular expressions for fuzzy batch deletion of keywords in Word is suitable for processing structured content across a large number of docx documents. Through the "Find and Replace Keywords in Word" function of HeSoft Doc Batch Tool , you can import multiple Word files first, then select "Use formula for fuzzy text search," enter the regular rules, and leave the replacement content empty, thus achieving batch deletion.
Compared to manually opening Word documents one by one for find and delete operations, this method significantly reduces repetitive work, making it especially suitable for cleaning up course materials, contract templates, project documents, numbered text, and batch-exported Word files. It is recommended that you prepare test files before official processing, confirm the rules are correct, and then execute the batch operation on all files. This approach enhances efficiency while ensuring reliable processing results.