1. wildcard.
For example, to replace all rows starting with // del
// Del * ^ 13 {1}
Why not input the replacement?
([^ 11 ^ 13]) {1}
Match a CIDR Block character (^ 13, which is obtained by entering enter directly in the document) or a line break in the CIDR Block (^ 11, obtained by entering SHIFT + enter in the document ). Square brackets match any character in the Set in square brackets. "{N}" indicates matching n times, so "{1}" indicates matching once. As for the parentheses, they have the same functions as the parentheses mentioned above. I think they are redundant here.
By default, JavaScript is greedy. Which of the following must be added for the minimum matching of Java regular expressions? . Wildcard characters in Word documents are matched in non-Greedy mode.
2. VBA programming method.
Procedure 1:
Sub test ()
Selection. homekey wdstory
With selection. Find
. Clearformatting
'This example removes the format restriction from the search criteria before searching for the selected content.
Do while. Execute (findtext: = "del //")
. Parent. bookmarks ("\ line"). range. Delete 'indicates a continuous area in the document. Each range object is defined by a starting character position and a ending character position.
Loop
End
End sub
Procedure 2
Sub kill ()
For 1 to 500
Selection. find. execute findtext: = "del //", forward: = true, wrap: = wdfindcontinue 'If the prompt is not from the beginning of the text, when the end of the text is found, whether to continue from the beginning of the text to find the start of the 'position, wdfindstop.
If selection. Find. Found = true then
Selection. homekey
Selection. endkey extend: = true
Selection. Delete
End if
Next I
End sub