Community
    • Login

    Delete string and next two lines and repeat ?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    16 Posts 6 Posters 3.6k 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.
    • EkopalypseE
      Ekopalypse @Meta Chuh
      last edited by

      @Meta-Chuh

      Hey, this happens to me also.
      I, mostly, don’t see anyone typing or reading and then when I’m posting, another post has just arrived already.
      Thought this might be related with my setup but now …

      1 Reply Last reply Reply Quote 2
      • Meta ChuhM
        Meta Chuh moderator @PeterJones
        last edited by Meta Chuh

        hahhh, i can see @Terry-R typing now, but only terry, not even myself … terry, what did you do ;-)
        just kidding …

        1 Reply Last reply Reply Quote 1
        • Terry RT
          Terry R
          last edited by

          @PeterJones said:

          @Terry-R popped in and out a couple times

          I was about to type but got beaten both by yourself and @Meta-Chuh

          And good idea @PeterJones explaining the “replace-all” to OP. I suspect he hadn’t actually realised that that means a macro would NOT be needed.

          Funnily enough I had originally setup my forum profile to be ‘hidden’, only now I’m not when online, and can’t see the option I’d originally set.

          I prefer to be anonymous and be able to ‘pounce’ at a moments notice!

          Terry

          Meta ChuhM 1 Reply Last reply Reply Quote 3
          • Meta ChuhM
            Meta Chuh moderator @Terry R
            last edited by

            @Terry-R

            Funnily enough I had originally setup my forum profile to be ‘hidden’, only now I’m not when online, and can’t see the option I’d originally set.
            I prefer to be anonymous and be able to ‘pounce’ at a moments notice!

            you will be hidden for everyone as long as you just read, but afaik, once you start typing, you will be seen by all senior members, mods or admins, even if you are still set as invisible.

            1 Reply Last reply Reply Quote 0
            • Terry RT
              Terry R
              last edited by

              @Meta-Chuh said:

              you will be seen by all senior members, mods or admins

              I understand mods and admins, but who ranks as a senior member?

              Terry

              Meta ChuhM 1 Reply Last reply Reply Quote 1
              • Meta ChuhM
                Meta Chuh moderator @Terry R
                last edited by Meta Chuh

                @Terry-R

                if you check for yourself, and you are able to see everyone who’s typing, even though you know they are set to invisible, you can already consider yourself a senior member.
                if you are able to create a faq topic, you are a trusted vip senior member.
                if you are able to create an announcement, you are god 😉

                ps: if i see you typing an answer to a topic, i would never answer myself before reading yours. and as soon as i read yours, it doesn’t make any sense to answer at all with my janitor regex knowledge, as anything i could write would be baby-poo, so to speak ;-)

                1 Reply Last reply Reply Quote 3
                • Terry RT
                  Terry R
                  last edited by

                  @Meta-Chuh
                  Your replies are far from being baby-poo. I will sometimes still reply to an OP, even after reading someone else’s post, if I believe I can fill in some gaps, or perhaps provide an alternative idea/concept.
                  And I welcome other members feedback or alternatives to my solutions.

                  My motto
                  The day you stop learning is the day you die

                  Terry

                  Meta ChuhM 1 Reply Last reply Reply Quote 3
                  • Meta ChuhM
                    Meta Chuh moderator @Terry R
                    last edited by Meta Chuh

                    @Terry-R

                    thanks for your words.

                    I will sometimes still reply to an OP, even after reading someone else’s post, if I believe I can fill in some gaps, or perhaps provide an alternative idea/concept.

                    yes, you are absolutely correct and encouraged to do so any time, so please don’t stop that.
                    the only thing i wanted to tell you in person (albeit being typed), is that every single post i have read from you, leaves nothing open from my point of view.

                    ps: no boot licking whatsoever.
                    you have seen that i give my second opinion to some posts, but for now never to yours.
                    just a little kudos from my part and this was an opportunity to do so.

                    The day you stop learning is the day you die

                    i second that completely, as i can see some “walking dead” every once in a while … even though i don’t have a sixth sense that i know of ;-)

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

                      Hi, @terry-gaff, @terry-r, @meta-chuh, @peterjones, @eko-palypse and All

                      An other syntax of the Peter’s search regex could be :

                      (?-is)^TBA - TO BE ASSIGNED\R(.+(\R|\Z)){2}, which also grabs the 2 subsequent lines, along with the line TBA - TO BE ASSIGNED.

                      Of course, the line, located, right after the line TBA - TO BE ASSIGNED, can never end with the \Z assertion, but it doesn’t matter !

                      Notes :

                      • (?-is) represents two in-line modifiers :

                        • -i means that the search is processed with respect to letters case

                        • -s means that the dot meta-character, ., represents a single standard character ( not an EOL char ! )

                      • The \R, roughly, stands for any kind of line-break ( \r\n with Windows, \n with Unix and \r with Mac )

                      • So, the part ^TBA - TO BE ASSIGNED\R looks for the literal line TBA - TO BE ASSIGNED, followed with its like-break

                      • Then the part .+(\R|\Z) match any non-null line, with its line-break, as well as a possible line, only followed with line-breaks, before the very end of the document. ( Note that the \Z assertion represents any number, even 0, of consecutive line-break characters, before the very end of current file )

                      • And, as this part is embedded in the syntax (.....){2}, this line must occur twice

                      • As the replacement zone is EMPTY, this means that these specific 3-lines blocks of text are simply deleted

                      Best Regards,

                      guy038

                      1 Reply Last reply Reply Quote 2
                      • Terry GaffT
                        Terry Gaff
                        last edited by

                        Meta Chuh, Guy038 etc.
                        Many thanks indeed for your help and instructions. The first reply by Meta Chuh was exactly what I was looking for. I needed to add this expression to my existing set of macros to my shortcuts file and Guy’s explanation was much appreciated also.
                        Terry

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