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.
    • Anon AA
      Anon A
      last edited by

      For example in html. I think its not possible using npp regex.
      Please don’t suggest smart solutions, I want some kind of prepared plugin/suggestion of other program to help or something trivial, if its more complicated please make video for youtube or other streaming platform. When I type the text into search query it work. Replacing text using extended search attributes (/r/n) don’t work for me on version 5.1. The text contains some obligatory spaces I think I can manually correct.

      I came from there

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

        @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
        • Anon AA
          Anon A
          last edited by Anon A

          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”>

          andrecool-68A 1 Reply Last reply Reply Quote 0
          • andrecool-68A
            andrecool-68 @Anon A
            last edited by

            @Anon-A said:

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

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

              @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
              • Terry RT
                Terry R
                last edited by

                @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

                Meta ChuhM Alan KilbornA 2 Replies Last reply Reply Quote 0
                • Meta ChuhM
                  Meta Chuh moderator @Terry R
                  last edited by Meta Chuh

                  @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
                  • Alan KilbornA
                    Alan Kilborn @Terry R
                    last edited by

                    @Terry-R

                    I found a link for the portable version

                    Consider this a virtual downvote to that. :)

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

                      @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

                      Alan KilbornA 1 Reply Last reply Reply Quote 2
                      • PeterJonesP
                        PeterJones
                        last edited by

                        @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

                        Meta ChuhM 1 Reply Last reply Reply Quote 3
                        • Alan KilbornA
                          Alan Kilborn @Terry R
                          last edited by Alan Kilborn

                          @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
                          • Meta ChuhM
                            Meta Chuh moderator @PeterJones
                            last edited by

                            @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
                            • First post
                              Last post
                            The Community of users of the Notepad++ text editor.
                            Powered by NodeBB | Contributors