• Login
Community
  • Login

another search and insert(=delete) problem

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 860 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.
  • K
    Krokodils Freundin
    last edited by Sep 21, 2018, 7:49 PM

    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
    • P
      PeterJones
      last edited by Sep 21, 2018, 9:01 PM

      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
      • K
        Krokodils Freundin
        last edited by Sep 22, 2018, 9:11 AM

        thank you very much.

        1 Reply Last reply Reply Quote 0
        2 out of 3
        • First post
          2/3
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors