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,000starting tags and500,000ending tags, in one step, take the same time, whatever the regex syntax used !Best Regards,
guy038
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login