Community
    • Login

    macro search between <section>fixed & changing characters</section>

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 421 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.
    • Fedor AlphenaarF
      Fedor Alphenaar
      last edited by

      How can I search for a string that is changing in certain area’s and is different for different pages.

      You see two strings below that changes when I publish my site through the software builder.
      This string contains the domain name of the builder and although I understand why they do it, for SEO it is just very bad practice.
      Currently, I have created a macro that adds “rel = nofollow” between <a & href="https://domain.name>

      However, I rather get rid of this link at all therefore I am looking to build a macro that
      a) search on the part that never change which is "<section class=“engine”><a href=“https://domain.name”
      b) remove everything between <section class=“engine”> and the closing </section>

      When I publish 5 pages then each page has a different line where the character behind the domain name is changing (or no character at all) and the anchor text is changing.

      <section class=“engine”><a href=“https://domain.name/n”>simple site templates</a></section>
      <section class=“engine”><a href=“https://domain.name/g”>build a site</a></section>

      If not possible with Notepadd++ maybe there is an editor that can do it.

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @Fedor Alphenaar
        last edited by

        @Fedor-Alphenaar

        I assume you can build a regex which would look like that
        find with:(?s)(<section class="engine">)<a href="https\:\/\/domain\.name.*?(</section>)
        replace with:\1\2

        Is this doing what you want to achieve?

        Fedor AlphenaarF 1 Reply Last reply Reply Quote 2
        • Fedor AlphenaarF
          Fedor Alphenaar @Ekopalypse
          last edited by

          @Ekopalypse many thanks, that indeed works and it basically removes it. saves a lot of time

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