Community
    • Login

    Search after 2 character and delete alle between

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 4.5k 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.
    • Steen Frank MikkelsenS Offline
      Steen Frank Mikkelsen
      last edited by

      Hi

      Can Notepad ++ does this:
      Search for 2 character and delete these two character and all between ?

      Example
      Search after “(” and “)”
      Results:
      (summer)
      (sun)
      (flower)

      and delete all instances of:
      (summer)
      (sun)
      (flower)

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC Offline
        Claudia Frank @Steen Frank Mikkelsen
        last edited by

        Hello Steen-Frank-Mikkelsen,

        one way would be to use regular expressions with replace dialog.
        When dialog has been opened check Regular Expression in
        Search Mode section.
        Then put the following in Find what: (()(.*)())
        and in Replace with: \1\3

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • guy038G Offline
          guy038
          last edited by guy038

          Hello, Steen Frank Mikkelsen and Claudia,

          I think that the correct regex S/R should be :

          • \(.*?\) in the Find what : zone

          • Nothing in the Replace with : zone

          with the Regular expression search mode checked, of course !

          Notes :

          • The two round brackets, that have to be matched, must be escaped with a backslash character, in order to be taken literally, as there are special regex characters, which define a group

          • The syntax .*? represents the shortest string of characters, between the two round brackets

          • The other syntax .* would have matched the largest string, between two round brackets. So, it could contain round brackets, itself !

          Best Regards,

          guy038

          1 Reply Last reply Reply Quote 1
          • Claudia FrankC Offline
            Claudia Frank
            last edited by

            oopps, I thought ( ) should remain, but if I reread it clearly states
            Search for 2 character and delete these two character and all between ?

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 0

            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