Community
    • Login

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

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 683 Views 1 Watching
    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 Offline
      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 Offline
        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 Offline
          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

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors