This article focuses on the office need of deleting entire paragraphs in Word based on wildcard or regular expression rules, explaining how to use HeSoft Doc Batch Tool to perform batch cleanup. In the example, multiple docx files contain appendix paragraphs such as Annex A, Annex B, etc. By selecting "Use formula to fuzzy find text", entering Annex [A-Z], and leaving the replacement content empty, you can delete the complete paragraphs that contain the matching keywords. Suitable for batch processing reports, directories, templates, and exported documents.
In Word document organization, "deleting entire paragraphs containing a specific keyword" is a very common but easily underestimated requirement. For example, you receive a batch of docx reports, each file containing appendix paragraphs like Annex A, Annex B, and Annex C, and the delivery version no longer requires these entries. Manual deletion seems simple, but as the number of files increases, it consumes a lot of time, and the positions of these paragraphs may vary across different documents.
A more efficient approach is to use office software that supports batch processing, delegating these repetitive rules to the tool. This article uses " HeSoft Doc Batch Tool " in the screenshots as an example to illustrate how to use wildcard or regex-like fuzzy matching formulas to batch delete entire paragraphs containing keywords in Word, docx, and doc files.
Applicable Scenarios: Use When Cleaning Word Paragraphs According to Rules
Deleting entire paragraphs based on regex or wildcard rules is suitable for situations where "the target text has patterns but is not exactly identical." For example, the letters in Annex A, Annex B, and Annex C differ, but the structure is the same; or, "Chapter 1," "Chapter 2," "Chapter 3" have different numbers but consistent formatting. As long as a common pattern can be summarized, fuzzy matching methods can be used.
Compared to standard find-and-replace, this method has two distinct advantages. First, it reduces the number of keywords you need to input, eliminating the need to list every single variation. Second, it acts on entire paragraphs rather than just replacing the few matched characters. This is critically important for tasks like table of contents cleanup, appendix removal, template instruction deletion, and batch report organization.
If your goal is to delete paragraphs containing a certain type of keyword, rather than deleting entire pages or sections, you can refer to the workflow in this article. Especially when dealing with a large number of files, batch processing tools can significantly reduce manual operations.
Effect Preview: Before Processing, Target Paragraphs Are Distributed Below "Annexes"
In the Word screenshot before processing, there are multiple appendix entries below the "Annexes" heading. The red boxes highlight keywords like Annex A, Annex B, Annex C, and Annex D, with arrows pointing to the areas that need to be deleted. These paragraphs are not the isolated keywords themselves, but the keywords followed by long descriptive text.

If only using Word's built-in standard find function, you would still need to manually review each match and then delete its containing paragraph. While acceptable for a single file, this is highly inefficient for batch processing. The goal demonstrated here is: set up a rule once and let the software automatically locate and delete these paragraphs across multiple Word files.
Effect Preview: After Processing, Annex A and Other Entries Have Been Removed from Word
The screenshot after processing shows that the paragraphs for Annex A, Annex B, Annex C, Annex D, etc., originally located below the "Annexes" heading, have been deleted, while the "Annexes" heading itself remains. The subsequent Introduction content is still preserved, indicating that this cleanup did not affect non-target body text.

This effect highlights the importance of rule setting: the expression must match the target paragraphs without being overly broad. The example uses "Annex [A-Z]," which is more precise than using "Annex" alone, thus avoiding the "Annexes" heading and only processing entries where "Annex" is followed by a letter.
Operation Step 1: Select the Correct Word Batch Processing Function
Open " HeSoft Doc Batch Tool " and enter "Word Tools" from the left-side categories. This software is a document batch processing tool designed for office scenarios, with the core value of batching repetitive file operations, such as batch replacement, batch watermarking, batch format conversion, and batch image deletion.

This time, do not select the standard "Find and replace keywords in Word," but choose "Find and replace entire paragraphs in Word based on keywords." As the function name indicates, it processes whole paragraphs containing a keyword, making it more suitable for tasks like "deleting an entire table of contents entry" or "deleting a specific description paragraph."
Clicking this function will lead to a wizard-style page. The steps at the top include selecting records, setting processing options, setting save location, and starting processing. By following this sequence, you can first confirm which files to process, then decide how to delete, and finally output the results uniformly.
Operation Step 2: Add Multiple Word Files to Be Cleaned
In the first step, add the Word files to be processed to the list. The screenshot shows "Add Files" and "Import Files from Folder" in the upper right corner. If you are only processing a few documents, you can add them one by one; if an entire batch of docx files is stored in a single directory, importing from a folder is more time-saving.

The example list already includes 5 files, all with the .docx extension, located as different files under the path D:\test\. The list also displays creation time and modification time, facilitating verification of whether the files are required for this task. For batch deletion tasks, file verification is very important, as adding an unrelated file means the subsequent rules will also apply to it.
After confirming the files are correct, click "Next Step" at the bottom. If there are files in the list that do not need processing, you can remove them first via the delete icon in the operation column; if you need to re-import, you can clear the list and add again.
Operation Step 3: Use Annex [A-Z] to Match a Category of Keyword Paragraphs
After entering "Set processing options," first select the search method. In the screenshot, the currently selected option is "Use formula for fuzzy text search," which is key to implementing wildcard or regex rule matching. It is suitable for handling target content that has some variation but shares a common pattern.

Enter in "Keyword list to search for":
Annex [A-Z]
Here, [A-Z] denotes the range of uppercase English letters. Combined, it can match formats like Annex A, Annex B, and Annex C. Since the name of this function explicitly states it finds and replaces entire paragraphs in Word, any paragraph containing this match result will be processed according to the subsequent replacement rule.
Next, look at the "Replaced keyword list" on the right. The hint in the screenshot says "Leaving it blank means deletion," so in this example, to delete paragraphs, leave the right side blank. This results in: matched paragraphs are not replaced with other text but are directly removed.
This step is the most critical setup in the entire workflow. It is advisable not to use keywords that are too short or too broad. For instance, writing only "Annex" might match "Annexes"; also, avoid writing just a letter range, as it might incorrectly affect the main text. Try to combine the fixed part and the variable part to improve matching accuracy.
Operation Step 4: Output New Files and Check Processing Results
After completing the setup, click "Next Step" to enter the save location settings. When batch processing Word documents, it is recommended to save the processed files to a new directory, keeping the original files as a backup. Especially when dealing with regex, wildcards, or fuzzy searching, preserving the originals is a safer practice.
After setting the save location, proceed to "Start Processing." Before formally executing, you can reconfirm three things: is the file count correct, is the expression Annex [A-Z], and is the replaced keyword list empty. Start processing only after confirmation.
Once processing is complete, open the output docx files for spot-checking. You can first search for Annex A or Annex B to confirm if these paragraphs have been deleted; then check the Annexes heading and body text to confirm that non-target content is preserved. The post-processing screenshot in the example already shows that the target entries were removed while the heading and subsequent body text remain.
Frequently Asked Questions and Notes
1. Is this a Word regular expression?
From the software interface, the function option name is "Use formula for fuzzy text search." It can be used for fuzzy matching similar to wildcard or regex rules. The actual expression syntax should follow the rules supported by the software; this article explains based on the Annex [A-Z] example from the screenshot.
2. Why not just search for Annex directly in Word?
Word's built-in search is suitable for single-file locating, but batch processing multiple files still requires manually opening, finding, deleting, and saving each one. The advantage of a batch processing tool lies in setting a rule once and applying it to multiple files simultaneously, reducing repetitive work.
3. Does leaving the replacement content blank always mean deletion?
Next to the "Replaced keyword list" on the right in the screenshot, you can see the hint "Leaving it blank means deletion." Therefore, in this function, keeping the replacement list empty deletes the matched paragraphs.
4. How to reduce accidental deletion?
First, test with a small sample of files, do not process all files directly; try to make the expression as specific as possible; output to a new folder; spot-check the results after processing. If the rule is found to be too broad, adjust the keyword expression.
5. What if the document contains lowercase "annex a"?
The screenshot shows an "Ignore case" option. If the document has inconsistent capitalization, you can enable it as needed or adjust the expression. It is recommended to verify with samples first to ensure the match scope aligns with expectations.
Summary: Boost Word Cleaning Efficiency with Rule-Based Batch Processing
Deleting entire Word paragraphs based on wildcard or regex rules is suitable for processing large volumes of docx and doc files with similar structures but slight detail variations. Through HeSoft Doc Batch Tool , repetitive steps like "open file, find keyword, select paragraph, delete, save" can be transformed into a single batch task.
In the example in this article, using the "Find and replace entire paragraphs in Word based on keywords" function, selecting "Use formula for fuzzy text search," entering Annex [A-Z], and leaving the replacement content blank, successfully deleted paragraphs containing keywords from Annex A to Annex D. In actual work, you can substitute other expressions based on your own document patterns. It is recommended to test first, then execute in batch, which improves efficiency while ensuring the quality of document processing.