Community
    • Login

    Bookmark sets of lines that does not meet criteria

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    21 Posts 5 Posters 5.3k Views
    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
      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
      • First post
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors