Community
    • Login

    Delete characters in URLs

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 745 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.
    • Romain BernhardR
      Romain Bernhard
      last edited by Romain Bernhard

      Hello,

      I need help to turn hundreds of Amazon affiliate links into non-affiliate links.

      For each URL, I need to remove all the characters that if after the product ID (B0xxxxxxxx).

      Thanks for your help guys.

      Initial text

      https://www.amazon.es/siete-maridos-Evelyn-Umbriel-narrativa-ebook/dp/B084X8WM2J?&linkCode=sl1&tag=quelibro-21&linkId=cd6016a5fdc1802be4f8b009277c44bc&language=es_ES&ref_=as_li_ss_tl
      https://www.amazon.es/Todos-quieren-Daisy-Taylor-Jenkins-ebook/dp/B086LKDQDS?&linkCode=sl1&tag=quelibro-21&linkId=9c5225ee1130e513d649c1f0a2e20083&language=es_ES&ref_=as_li_ss_tl
      https://www.amazon.es/Por-siempre-unidos-Titania-fresh-ebook/dp/B08KGF6YXG?&linkCode=sl1&tag=quelibro-21&linkId=0216a2ed6c631d3f04e754d968b0fb5f&language=es_ES&ref_=as_li_ss_tl

      Desired result

      https://www.amazon.es/siete-maridos-Evelyn-Umbriel-narrativa-ebook/dp/B084X8WM2J
      https://www.amazon.es/Todos-quieren-Daisy-Taylor-Jenkins-ebook/dp/B086LKDQDS
      https://www.amazon.es/Por-siempre-unidos-Titania-fresh-ebook/dp/B08KGF6YXG

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Romain Bernhard
        last edited by

        @romain-bernhard ,

        • FIND = (?-s)/B0\w{8}\K.*$
          • finds /B0 followed by 8 alphanumeric, then resets the match, and actually selects everything on the line after that
        • REPLACE = make this box empty
        • SEARCH MODE = regular expression

        ----

        Useful References

        • Please Read Before Posting
        • Template for Search/Replace Questions
        • FAQ: Where to find regular expressions (regex) documentation
        • Notepad++ Online User Manual: Searching/Regex
        Romain BernhardR 1 Reply Last reply Reply Quote 1
        • Romain BernhardR
          Romain Bernhard @PeterJones
          last edited by

          @peterjones Great work. Thank you very much for your quick reply. I will save a lot of time thanks to you. You are a true genius. Many thanks again.

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