Delete string and next two lines and repeat ?



  • @PeterJones

    damned, why didn’t we see each other writing at the same time ?
    sometimes the ajax just gets stuck and i don’t see people already typing.
    my apologies, i usually never post if i see that you or another regular is already typing.



  • @Meta-Chuh said:

    why didn’t we see each other writing at the same time

    I didn’t even see you in the topic, let alone typing. @Terry-R popped in and out a couple times, but I never saw him start typing, which is why I continued going. AJAX is imperfect, I guess. :-)

    And ++ for including the macro the OP asked for. :-)



  • @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 …



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



  • @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



  • @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.



  • @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



  • @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 ;-)



  • @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



  • @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 ;-)



  • 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



  • 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


Log in to reply