Bookmark sets of lines that does not meet criteria
-
Hello @alan-kilborn and All,
I’ve found out a simple example of the advantage of the conditional feature !
Let’s suppose that you have a particular tag
<guy>
and that you want :-
To delete the starting tag
<guy>
with, both, its leading and trailing space chars -
To delete the ending tag
</guy>
with its leading space char, only
-
The simple and obvious solution is :
-
SEARCH
\x20<guy>\x20|\x20</guy>
-
REPLACE
Leave EMPTY
-
-
Now, this shorter regex S/R, with a conditional expression, related to group
1
, is :-
SEARCH
\x20<(/)?guy>(?(1)|\x20)
-
REPLACE
Leave EMPTY
-
I verified that the suppression of
500,000
starting tags and500,000
ending tags, in one step, take the same time, whatever the regex syntax used !Best Regards,
guy038
-