delete line between bookmark



  • @pinuzzu99 said in delete line between bookmark:

    I’m very sorry to have come to this, but someone’s behavior is really heavy …

    Your behavior is really greedy. You have asked many questions, demanded quick replies, requested specific attention, and never posted one helpful answer to anyone else’s questions.

    it doesn’t seem appropriate to study a code that i don’t need.

    It doesn’t seem appropriate for us to do your work for you. Since you have proven at least four times in the last month that you do need the tool (regex), claiming you don’t need it is deceiving yourself, at best.

    You don’t have to become an expert at regex right away… and we don’t expect you to. However, we expect you to show some effort. Try some regexes, see if you can make them work for what you want to do. If you have trouble with one, show the regex you tried, show why you tried it, and explain what is wrong with the results it gives. With that much effort on your part, we will help you understand what you are doing wrong, so that we can help you learn. But if you just say “make this change for me – and make it right now! on my schedule!”, then you will not be able to learn.

    if you don’t want to help me for anything else, nobody forces you.

    You are not asking for help. you are asking us to write regexes for you, showing no effort to try to do them yourself. Throwing fish down your mouth isn’t helping you; teaching you how to fish is helping you; and asking that you at least learn how to cast the lure yourself, even if you’ve chosen the wrong lure for your specific fish, is a reasonable expectation.

    I am registered in numerous forums, and where i can i give my contribution.

    But you’ve never contributed anything but questions, and have shown a demanding, unwilling to try to learn attitude here. That’s all we have to go on. We haven’t seen you be willing to learn; we haven’t seen you try to help others. We have just seen your demands.

    and anyway to conclude, there are other forums, including stackoverflow, where others help without controversy. from now I will turn there.

    hahaha! Stack Overflow is about the most unhelpful forum I’ve ever seen. If you deign to ask a question similar to what’s been asked before, your question gets closed without any input from you.

    I only hoped, since guy038 had shown me a way, that he would help me to reach a conclusion.

    This is not personal one-on-one time. When Guy has opportunity, I am sure he will come back and answer your slight tweak. But demanding a certain person reply, and starting to ask “why haven’t you answered” after only 12 hours delay, is not polite forum behavior.

    my post was addressed to him, who without controversy has kindly helped me to solve my problem.

    But he has repeatedly asked you to show some effort, and you ignore that.

    I repeat, i believe that if one person can help others, he or she is better, otherwise it is better to refrain from controversy. regards.

    We are helping you. We are explaining to you the best way to get help: be polite, don’t be demanding, show that you are willing to try things and to learn.

    Back to your question:

    but i don’t understand why if i click (after the text block after mail has been selected) Replace with: empty don’t delete simply this block… i have to exit the find and delete it manually with the DEL key.
    it would be very nice to remove the block with the Replace with key… it’s not possible that??

    It is possible to replace all. However, inside the dialog, single replaces don’t work with the \K, as Guy already explained to you. If you want to replace one at a time, you do the first search from the dialog, then exit out of the dialog box. From then on, DEL and F3 will allow you delete and then do the next one-at-a-time search.

    edit: I see that Guy posted the same thing while I was typing.



  • @PeterJones said in delete line between bookmark:

    we expect you to show some effort. Try some regexes, see if you can make them work for what you want to do. If you have trouble with one, show the regex you tried, show why you tried it, and explain what is wrong with the results it gives

    This is good and proper advice, but I think what the “takers” will start doing (to satisfy it) is grabbing the last freebie regex given to them, throw a couple of crap characters in it, and then post back, going “Wah wah it doesn’t work!”, without putting any real thought (or, forbid, learning) into it.

    The “takers” seem to quickly establish a pattern in their behavior, as exemplified above, and in many other chains.

    And all this in a forum that isn’t about regular expressions, but rather Notepad++!



  • @Alan-Kilborn said in delete line between bookmark:

    @PeterJones said in delete line between bookmark:

    we expect you to show some effort. Try some regexes, see if you can make them work for what you want to do. If you have trouble with one, show the regex you tried, show why you tried it, and explain what is wrong with the results it gives

    This is good and proper advice, but I think what the “takers” will start doing (to satisfy it) is grabbing the last freebie regex given to them, throw a couple of crap characters in it, and then post back, going “Wah wah it doesn’t work!”, without putting any real thought (or, forbid, learning) into it.

    That’s why here I said “show why you tried it”, and in my fuller boilerplate, I say, “why you thought that regex would work (to prove it wasn’t just something randomly typed)”



  • @PeterJones said in delete line between bookmark:

    randomly typed

    Heheh, hadn’t seen the “randomly typed” part before, but, not being the one that has ever needed to read your boilerplate thoroughly, I guess I’m not surprised. :-)

    BTW, I can’t see any of the “takers” truly ever reading your BP either, but… :-)



  • with this post I always want to thank guy038 very much for his availability towards me.

    moreover, @ PeterJones, leaving aside unnecessary controversy, I would just like to tell you that instead on Stackoverflow, since I wasn’t sure that guy038 was answering me, and since nobody was helping me here, I asked my question and not only as you say it has not been closed, but indeed they replied immediately, within a few minutes, solving my problem skillfully … in a few minutes …
    so rest assured that I will no longer bother you here. luckily there are other forums, and other users (as I do when I can) who are happy to satisfy a request for help.
    with this, however, a greeting to all. closed.



  • Hi, @pinuzzu99 and All,

    That’s it, I got it !. In fact, the new regexes, below, are simply derived from the one given in a previous post of this present discussion :

    https://community.notepad-plus-plus.org/post/50425


    So :

    SEARCH (?-s)^((?!.+@).+\R?)+ ( to delete any bunch of consecutive lines, not containing an e-mail address

    SEARCH (?-s)^((?!.+@).*\R?)+ ( to delete the empty lines, as well ! )

    REPLACE Leave EMPTY

    Notes :

    • These two regexes match any non-null range of lines, which does not contain, each, the @ symbol

    • Of course, if your caret is located somewhere between two e-mail addresses, it will catch, only, from current location till the last line before a line containing an e-mail address

    • With these syntaxes, you may use the step-by-step replacement, with successive clicks on the Replace button

    • It does not mind the lack of a last line-break, at the very end of of the current file

    Best Regards,

    guy038



  • @pinuzzu99, @Peterjones, @alan-kilborn and All,

    @alan-kilborn, you said :

    And all this in a forum that isn’t about regular expressions, but rather Notepad++!

    You’ve got a point, there !! @Scott-sumner felt the same way, in this post :

    https://community.notepad-plus-plus.org/post/35723

    Have a look, at the same time, to my reply and question :

    https://community.notepad-plus-plus.org/post/35742

    Again, I wonder if most of my answers are relevant, in this forum ? I mean, all this should be dealt with in a forum dedicated to regular expressions However, note that I specifically speak about N++ functionalities of our regex engine !

    Ah, ah : that could be a government slogan : Too many regular expressions can seriously damage your health !

    Cheers

    guy038



  • @guy038

    I think some degree of discussion is quite fine and appropriate. People start out with some data, a need to do something to it, and a tool (our beloved N++). What else are they to do but ask (on a N++ forum) “how can I do this with N++?” And that’s totally fine.

    And the “weirdness” of the N++ engine? Also a very good topic here.

    But, yea, slogging thru a lot of posts of typical regex handholding gets old, and I agree with you that it is better on a regex dedicated site. Hopefully you are patrolling those as well and helping the rest of the world with regex! :-)



  • @pinuzzu99 said in delete line between bookmark:

    greeting to all. closed.

    You’ll probably not read this (or see Guy’s excellent reply), but for future readers of this thread, I have to make a couple more statements

    I wasn’t sure that guy038 was answering me,

    Because it took more than 12 hours!? For future readers: some problems take more than 30seconds to solve, and on non-live forums, it can take a day or two.

    and since nobody was helping me here,

    We were all helping you. And both Guy and I answered almost simultaneously today explaining exactly why replace all worked but replace (once) didn’t. If that’s not helping you, I don’t know what is.

    Beyond that, we were helping you, explaining that in help forums, asking politely, not demanding immediate response, and showing an effort to learn is a much better way to get help.

    I asked my question and not only as you say it has not been closed, but indeed they replied immediately

    Well, the userbase of of Stack Exchange is probably a thousandfold more than this Community, so there are a lot more to draw from.



  • @guy038 tank you so much, your last string (?-s)^((?!.+@).+\R?)+ work very well for my purpose! Regards.


Log in to reply