Community
    • Login

    another search and insert(=delete) problem

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 1.1k 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.
    • Krokodils FreundinK Offline
      Krokodils Freundin
      last edited by

      actually i am completely stumped - maybe someone can help me…

      Using search and insert i want to replace (therefore delete) any entries in a text looking like that:

      [1 Kekse]
      [22 Kekse]

      Can somebody please help? Thanks.

      1 Reply Last reply Reply Quote 0
      • PeterJonesP Offline
        PeterJones
        last edited by

        It would be nice if you showed what you tried, or at least what your thought process was: “If I were doing this manually, here are the explicit pieces I would look for to determine whether something was a match or not”. For example, I see that and I say "I want to delete lines that start with a bracket, then has one or more digits, a space, the exact text “Kekse”, end bracket, and end of line.

        I then convert that to regex syntax.

        Given the data:

        header
        [1 Kekse]
        [1 something else]
        random text
        [22 Kekse]
        footer
        

        with FIND = “\[\d+ Kekse\](\R|\Z)” and REPLACE = “” (empty), I get

        header
        [1 something else]
        random text
        footer
        

        which would, I believe, match your limited description.

        (I have tried to be more helpful and less preachy this time. However, if you are going to have more regex questions, I highly recommend trying to learn a little of the regex syntax yourself. It’s useful for more than programmers, as you can see. At some point, I have a feeling that asking for freebies will stop working for you: first in this forum, then in the next forum you try, and so on.)

        -—
        For other users who might be reading this: if you want to learn more, follow the links in this FAQ about regex documentation

        1 Reply Last reply Reply Quote 1
        • Krokodils FreundinK Offline
          Krokodils Freundin
          last edited by

          thank you very much.

          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