• Login
Community
  • Login

Find and delete <p></p>line in HTML

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
6 Posts 3 Posters 689 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.
  • J
    jackdeland
    last edited by Jan 10, 2023, 4:04 PM

    I have code similar to this in 1600 files:

    <p>Return to <a href="syn-alonzo.htm">Top of Page</a>.</p>
    

    I need to find all lines starting with

    <p>Return to
    

    and ending in

    </p>
    

    and delete them (i.e., replace with nothing).
    I have tried out dozens of examples and samples from everywhere, but cannot figure out to escape the <p>. It’s embarrassing, but I am out of time and would really appreciate some help.

    P 1 Reply Last reply Jan 10, 2023, 4:39 PM Reply Quote 0
    • P
      PeterJones @jackdeland
      last edited by Jan 10, 2023, 4:39 PM

      @jackdeland said in Find and delete <p></p>line in HTML:

      I have tried out dozens of examples and samples from everywhere

      And yet you didn’t show us any of what you tried… we could have explained why those didn’t work, and thus you would have learned something from it. Instead, I just have to toss you a fish, and hope that’s sufficient for you to learn how to fish on your own. Good luck.

      FIND = (?-s)<p>Return to.*</p>\R
      REPLACE = (leave input empty)
      SEARCH MODE = regular expression

      ----

      Useful References

      • Please Read Before Posting
      • Template for Search/Replace Questions
      • Formatting Forum Posts
      • Notepad++ Online User Manual: Searching/Regex
      • FAQ: Where to find other regular expressions (regex) documentation
      1 Reply Last reply Reply Quote 2
      • J
        jackdeland
        last edited by Jan 10, 2023, 4:55 PM

        Do you really want approx. 60 permutations and slapdash tries at everything? I am working 4 deadlines currently and don’t have anymore time to learn all I need. I have only twice asked for help in a forum with others far beyond my tech proficiency in one area, and I see I am dealing with some very insecure people. SO glad I am not in your world.

        P A 3 Replies Last reply Jan 10, 2023, 5:17 PM Reply Quote -2
        • P
          PeterJones @jackdeland
          last edited by PeterJones Jan 10, 2023, 5:19 PM Jan 10, 2023, 5:17 PM

          @jackdeland ,

          Do you really want approx. 60 permutations and slapdash tries at everything?

          No. I just want you to show that you are putting in effort, and not just demanding that we do your job for you.

          I am working 4 deadlines currently and don’t have anymore time to learn all I need.

          That is unfortunate for you.

          You do understand that I am just a fellow user of Notepad++, who is here out of the kindness of my heart to help fellow users of Notepad++. I am not paid to help you; no one here is.

          The reason I suggest “showing what you tried” is because when people don’t, it tends to mean that they didn’t actually try anything themselves, or didn’t understand what they were trying.

          I handed you the free answer right away, even though I also suggested that showing more effort would be helpful to you.

          I see I am dealing with some very insecure people.

          That’s rather rude, considering I gave you the answer.

          ----

          Please note: This Community Forum is not a data transformation service; you should not expect to be able to always say “I have data like X and want it to look like Y” and have us do all the work for you. If you are new to the Forum, and new to regular expressions, we will often give help on the first one or two data-transformation questions, especially if they are well-asked and you show a willingness to learn; and we will point you to the documentation where you can learn how to do the data transformations for yourself in the future. But if you repeatedly ask us to do your work for you, you will find that the patience of usually-helpful Community members wears thin. The best way to learn regular expressions is by experimenting with them yourself, and getting a feel for how they work; having us spoon-feed you the answers without you putting in the effort doesn’t help you in the long term and is uninteresting and annoying for us.

          1 Reply Last reply Reply Quote 2
          • P
            PeterJones @jackdeland
            last edited by Jan 10, 2023, 5:22 PM

            @jackdeland ,

            Please do not delete posts or topics after replies have been given. Your post has been restored.

            1 Reply Last reply Reply Quote 1
            • A
              Alan Kilborn @jackdeland
              last edited by Alan Kilborn Jan 10, 2023, 6:35 PM Jan 10, 2023, 6:02 PM

              @jackdeland said in Find and delete <p></p>line in HTML:

              Do you really want approx. 60 permutations and slapdash tries at everything? I am working 4 deadlines currently and don’t have anymore time to learn all I need. I have only twice asked for help in a forum with others far beyond my tech proficiency in one area, and I see I am dealing with some very insecure people. SO glad I am not in your world.

              Wow. Seriously.

              Since the answer was provided before that rant was typed, paraphrasing it, I think it reads “Thank you Peter Jones for the kindly help”.

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