• Login
Community
  • Login

How to replace whole paragraph with extended replacement.

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
replaceparagraphsimple
12 Posts 6 Posters 2.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.
  • T
    Terry R
    last edited by Mar 10, 2019, 8:49 PM

    @Anon-A said:

    Replacing text using extended search attributes (/r/n) don’t work for me on version 5.1

    First off, you haven’t exactly given us a lot to go on. The title suggests you need to replace paragraphs, and you also refer to html code. So is it a paragraph in the original html code, or a paragraph as html code is shown in a browser? Is it a line as shown in Notepad++?

    Also the version 5.1, is this Notepad++ version, if so it’s seriously old, have you thought about upgrading the version. I currently use 7.6.3 which I’ll stay at until all the newer stuff settles down.

    Terry

    1 Reply Last reply Reply Quote 5
    • A
      Anon A
      last edited by Anon A Mar 12, 2019, 5:25 AM Mar 12, 2019, 5:22 AM

      The reason I use 5.1 is support for snippets+ and snippets plugin.
      Ok, there is sample
      Text to replace in some documents
      <ul>
      <a href=“www.site.com ”><li>This is a paragraph.</li>
      <a href=“C:\x\y\z”><li>This is a paragraph.</li>
      <a href=“www.site.com ”><li>This is a paragraph.</li>
      </ul>
      Replace with:
      <ul>This is a Heading
      <a href=“www.site.com ”><li>This is a paragraph.</li>
      <a href=“C:/x/y/z”><li>This is a paragraph.</li>
      <a href=“www.site.com ”><li>This is a paragraph.</li>
      </ul>

      or something like this:
      Text to replace in some documents
      <ul id=“id1”>This is a Heading
      <a href=“www.site.com ”><li>This is a paragraph.</li>
      <a href=“C:/x/y/z”><li>This is a paragraph.</li>
      <a href=“www.site.com ”><li>This is a paragraph.</li>
      </ul id=“id1”>
      Replace with:
      <ul id=“id1”>This is a Heading
      <a href=“www”><li>This is a paragraph.</li>
      <a href=“C:\x\y\z”><li>This is a paragraph.</li>
      <a href=“www”><li>This is a paragraph.</li>
      </ul id=“id1”>

      A 1 Reply Last reply Mar 12, 2019, 6:46 AM Reply Quote 0
      • A
        andrecool-68 @Anon A
        last edited by Mar 12, 2019, 6:46 AM

        @Anon-A said:

        The reason I use 5.1 is support for snippets+ and snippets plugin.

        1 Reply Last reply Reply Quote 3
        • T
          Terry R
          last edited by Mar 12, 2019, 7:09 PM

          @Anon-A said:

          The reason I use 5.1 is support for snippets+ and snippets plugin

          As @andrecool-68 has shown, Snippets is available in a later version. If you aren’t sure about upgrading to a later version, may I suggest installing a ‘portable’ version of Notepad++. It can work independently of an installed version. I’m not sure the Scintilla engine in the version you have will support all regular expression solutions someone might supply, there were at least 2 upgrades to that engine since your version, so very likely enhancements.

          At the moment I cannot see the link for the portable version, hopefully one of the other contributors might supply that info.

          As for your html code example, I’m still none the wiser what you want to replace. You show paragraphs between <li> and </li> codes. These could be used to pick only that text, even if over several lines by use of the regex modifier (?s) which means work over more than 1 line.

          Or do you mean to replace all code between the <ul> and </ul> codes?

          If you are replacing the html code in these blocks I’m wondering if you actually want a regex to do the replacement, or maybe you just want to use the "Mark’ function so you can more readily find the location and then change it manually. I can’t think of a reason to change multiple areas of code with the same replacement (which is where regex works best).

          Terry

          1 Reply Last reply Reply Quote 2
          • T
            Terry R
            last edited by Mar 12, 2019, 7:20 PM

            @Anon-A
            I found a link for the portable version, it’s at:
            https://portableapps.com/apps/development/notepadpp_portable

            There may be other links as well This is the 7.6.3 version, so very similar environment to what I use. It’s just shy of the latest version and is very stable. After this there has been a lot of changes and things are still settling down.

            Terry

            M A 2 Replies Last reply Mar 12, 2019, 7:36 PM Reply Quote 0
            • M
              Meta Chuh moderator @Terry R
              last edited by Meta Chuh Mar 12, 2019, 7:38 PM Mar 12, 2019, 7:36 PM

              @Anon-A @Terry-R and all

              please do not use the portableapps.com version, as it is currently broken regarding plugins.

              see here: https://notepad-plus-plus.org/community/topic/17200/7-6-3-plugins-admin-option-not-visible-in-menu
              and here: https://notepad-plus-plus.org/community/topic/17188/npppluginlist-dll-disappears-from-plugins-config-every-time-plugins-admin-disappears-also

              please only download the official portable version from >>> here <<< .

              full download page: https://notepad-plus-plus.org/download/
              (the zip packages are the portable versions)

              note: it is always recommended to use the official portable version only, as it is created by the developers, implementing all their own recent code changes.
              all other 3rd party releases might miss some code changes when packaging, leading to unexpected behaviour.

              1 Reply Last reply Reply Quote 4
              • A
                Alan Kilborn @Terry R
                last edited by Mar 12, 2019, 7:49 PM

                @Terry-R

                I found a link for the portable version

                Consider this a virtual downvote to that. :)

                1 Reply Last reply Reply Quote 1
                • T
                  Terry R
                  last edited by Mar 12, 2019, 8:13 PM

                  @Alan-Kilborn said:

                  Consider this a virtual downvote

                  So noted, sorry my bad.

                  I don’t use the portable version so was unsure of the correct location. The download page doesn’t readily identify the portable versions, so unless you know it’s the zip package it’s hard to spot.

                  Thanks for the heads-up.

                  Terry

                  A 1 Reply Last reply Mar 12, 2019, 8:24 PM Reply Quote 2
                  • P
                    PeterJones
                    last edited by Mar 12, 2019, 8:21 PM

                    @Terry-R said:

                    The download page doesn’t readily identify the portable versions

                    You’re right. I added issue #5415: website downloads page: mark “portable” downloads

                    M 1 Reply Last reply Mar 12, 2019, 9:06 PM Reply Quote 3
                    • A
                      Alan Kilborn @Terry R
                      last edited by Alan Kilborn Mar 12, 2019, 8:24 PM Mar 12, 2019, 8:24 PM

                      @Terry-R

                      The download page doesn’t readily identify the portable versions

                      Very true. All it says is “Don’t want to use installer?” next to the portable version downloads. It just adds to user confusion. Hey @donho, how about changing it on the website:

                      Go from:
                      Don’t want to use installer? Check this one (zip format).

                      To this:
                      Don’t want to use installer? Grab the Portable Version (zip format).

                      …and similar for the 7z format

                      1 Reply Last reply Reply Quote 4
                      • M
                        Meta Chuh moderator @PeterJones
                        last edited by Mar 12, 2019, 9:06 PM

                        @PeterJones

                        ps: i have also submitted quite a few issue and code reports lately, breaking my rule to submit one after the other, waiting until the first gets looked at or fixed.
                        so it seems as if i might already be a pain in the a… without “faq” 😂

                        @Alan-Kilborn

                        very cool new avatar logo. 👍
                        is it a preparation for a flood of upcoming a.k. animated gifs, with intro/outro splash screens (or family pictures), due to eventually having started to play around a bit, and beginning to like them ? 😉

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