by Mofi » Thu Feb 15, 2007 8:56 am
No problem, escape the * character. For UltraEdit style you can use for example following search string:
%[ ^t]++/^*^*^*+[~*]+^*^*^*+/[ ^t]++^p
%[ ^t]++ means from start of a line with 0 or more spaces or tabs.
/^*^*^*+ followed by /*** and more *.
[~*]+ all characters except *. That means it will not work if there is a block comment which contains a * inside the comment.
^*^*^*+/ followed by *** and more * before character /.
[ ^t]++^p matches possible existing trailing spaces and tabs and the DOS line termination.
But the better and more secure method to delete blocks with a defined start and end string, but undefined text between is to use a macro with the find select feature. Example macro which needs macro property Continue if a Find with Replace not found checked.
InsertMode
ColumnModeOff
HexOff
Top
Loop
Find "/***"
IfNotFound
ExitLoop
EndIf
Key HOME
IfColNumGt 1
Key HOME
EndIf
StartSelect
Find Select "***/"
IfSel
Delete
EndSelect
DeleteLine
Else
EndSelect
ExitLoop
EndIf
EndLoop
Top
The macro above contains some extra code for security. For your example the following simplified macro would do also the job:
InsertMode
ColumnModeOff
HexOff
Top
Loop
Find "/***"
IfNotFound
ExitLoop
EndIf
StartSelect
Find Select "***/"
Delete
EndSelect
DeleteLine
EndLoop
Top