, when there are similar but not identical contents in multiple Word, docx or doc documents, such as English abbreviations, numbers, numbers, code snippets, etc. in fixed formats, manually deleting files one by one is not only time-consuming, but also easy to miss. This article describes how to use HeSoft Doc Batch Tool The "Find and Replace Keywords in Word" function in, fuzzy matching through regular expressions, and leave the replacement content blank, to achieve batch deletion of specified pattern text in multiple Word files.
When sorting out a large number of Word documents, we often encounter such a problem: each file has some keywords that need to be deleted, but these contents are not exactly the same. For example, some places are three-digit capital English abbreviations, and some places are numeric numbers, school hours, codes or other variable content. If docx and doc files are opened one by one to find and delete manually, it is not only inefficient, but also easy to miss.
This kind of scenario is more suitable for office software that supports batch processing of files. Below to" HeSoft Doc Batch Tool "As an example, it demonstrates how to batch fuzzy delete keywords in multiple Word through regular expressions. In the example of this article, you need to remove similar from multiple Word files. BOT such three capital letters, and 60 such digital content.
Applicable Scenarios
use regular expressions to delete Word keywords in batches, which is suitable for document cleaning tasks that handle "the content is regular but the specific text is not fixed", for example:
- batch delete the number, number, year, amount and other contents in Word, docx and doc files;
- batch delete English abbreviations in fixed format, such as three capital letter codes;
- batch clearing of variable fields in contracts, course materials and reports;
- replace certain keywords in multiple Word documents with empty keywords to realize batch deletion;
- dozens or hundreds of Word files need to be processed at the same time to avoid repeated opening, searching and deleting.
As long as the content to be deleted can be described by regular expressions, it can be done in batches by "fuzzy search and replace with empty.
Effect preview: pre-treatment and post-treatment comparison
before processing: multiple Word files need to be cleaned up in a unified way
there are 6 Word documents in the sample folder, all with the file extension docx. In practice, if you need to process more Word files, you can also batch import in the same way.

Open one of the documents to see that the body contains the content that needs to be deleted. For example, at the beginning of the title BOT, and the numbers in the body 60. If these contents are scattered in multiple files, manual deletion will be very cumbersome.

After processing: the matched keywords are deleted in batch
after the processing is completed, the content that originally conforms to the rule has been deleted. For example, the three capital letters and numbers are cleaned up, and the other body content remains. In this way, the regular fuzzy deletion of multiple Word files is realized.

Steps: Use regular expressions to batch fuzzy delete Word keywords
step 1: Enter the Word tool and select "Find and replace keywords in Word"
open HeSoft Doc Batch Tool On the left, select Word Tools, and then in the function list, click "Find and replace keywords in Word". This function is used to find and replace keywords in the content of Word files in batches, and can also be deleted in batches by "replacing the content as empty.

The purpose of selecting this function is to allow the software to uniformly perform search and replace rules on multiple Word documents, rather than manually operating one by one.
Step 2: Add Word files that need to be processed
after entering the function page, in step 1 "select the records to be processed", you can pass add File import single or multiple Word documents, also import files from a folder batch import documents in a folder.

After the file is imported, the file sequence number, name, path, extension, creation time, and modification time are displayed in the list. In the example, a total of 6 files from 1.docx to 6.docx have been imported, indicating that these files will participate in subsequent batch processing.
After confirming that the file list is correct, click at the bottom of the page. Next step, enter the processing options settings.
Step 3: Select the fuzzy search method and enter the regular expression.
On the "Set Processing Options" page, you need to focus on setting the search method and keyword list. Since the content to be deleted this time is not a fixed word, but a text that conforms to a certain rule, the search method is selected. Blur find text with formulas.

on the left list of keywords to find enter the regular expression in. In the example, two rules are entered:
- [A-Z]{3}: matches three consecutive uppercase letters, such as BOT, ELA, etc;
- \d: matches one or more digits, such as 60, 2026, 123, etc.
The right side is list of keywords after replacement. In the screenshot, it is prompted that "if you do not fill in, it means delete", so in this case, the replacement content on the right is kept blank. In this way, the software will replace the contents matched by the regular expression on the left side with empty, that is, delete these contents during batch processing.
When the settings are complete, click next step, continue to enter the save location setting and start processing flow.
Step 4: Set the save location and start batch processing
the next steps can be seen in the page flow include set Save Location and start processing. It is suggested to save the processed Word file to a new directory, which is convenient to distinguish from the original file and to conduct spot check and comparison after processing.
After confirming the save location, enter the start processing step and let the software automatically execute the same set of find and replace rules for multiple imported Word, docx, or doc files. After the processing is completed, open the output file to check the effect and confirm that the keywords to be deleted have been cleaned up.
Regular Expression Setting Description
this example uses the "fuzzy lookup" idea, rather than finding exactly one fixed keyword. Common writing can refer:
- [A-Z]{3}: Matches three consecutive uppercase letters;
- \d: matches consecutive numbers;
- [A-Za-z] : Matches consecutive English letters;
- \s: Matches consecutive whitespace characters.
In practical use, the rules should be carefully written according to the content of the document. The wider the regular expression matching range, the more content is deleted. The more accurate the matching range, the lower the risk of accidental deletion.
Frequently Asked Questions and Precautions
1. Why can the content be deleted when the replacement list is empty?
Because the logic of finding and replacing is "after finding the content on the left, replace it with the content on the right". When the right side does not fill in the content, the matching text will be replaced with empty, which is equivalent to deleting from the Word document.
2. Will regular expressions delete other content by mistake?
It's possible. For example, [A-Z]{3} will match all three consecutive uppercase letters, not just the BOT. If the document also contains ELA, PDF, DOC, etc., it may also be matched. Therefore, it is recommended to back up the original file before processing, or test the rules with a small number of sample documents.
3. Can you delete many different rules at the same time?
You can. In the example, two rules of [A-Z]{3} and \d are entered at the same time in the keyword list to delete three uppercase letters and numbers at the same time. You can continue to add rules by row when you need to delete more types of content.
Can both doc and docx files be handled this way?
The screenshot in this article is a docx file. In actual batch processing, you can select the corresponding file according to the Word file type supported by the software import list. For important doc and docx documents, it is recommended to copy one copy before batch processing.
5. How to check the results after processing?
It is recommended to randomly open several processed Word files from the output directory, compare key positions such as title, text, number, etc., and confirm that the regular expression only deletes the target content and does not affect other important text.
Summary
when there are a large number of similar keywords that need to be deleted in multiple Word documents, using regular expressions to batch fuzzy deletion is much more efficient than manually searching one by one. By HeSoft Doc Batch Tool The "find and replace keywords in Word" function of, only need to import files, select fuzzy search, fill in regular expressions, and leave the replacement content blank, you can batch clean up the target text in multiple docx, doc files.
If you often need to sort out Word data, clean up numbers in batches, delete code abbreviations or process document contents in a unified way, it is recommended to prepare test files first, verify the regular rules and then execute them in batches, which can not only improve efficiency, but also reduce the risk of accidental deletion.