Community
    • Login

    Bookmark sets of lines that does not meet criteria

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    21 Posts 5 Posters 7.7k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • guy038G Offline
      guy038
      last edited by guy038

      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 and 500,000 ending tags, in one step, take the same time, whatever the regex syntax used !

      Best Regards,

      guy038

      1 Reply Last reply Reply Quote 1

      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
      • First post
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors