Community
    • Login

    Find & Replace question with RegEx solution

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 1 Posters 369 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.
    • JustinJudoJ
      JustinJudo
      last edited by PeterJones

      I have a URL that is like so:

      https://preview.redd.it/7zssyhn54gxa1.jpg?blah_blah
      

      I need the word ‘preview’ replaced with the letter i (lowercase I). And then everything after the ? replaced with nothing. Actually I need the question mark to be deleted as well.

      This is the end result I need:

      https://i.redd.it/7zssyhn54gxa1.jpg
      

      Fixing just 1 URL like this would be very simple but I have multiple URLs with this pattern. They are all on separate lines. I’d appreciate any help I can get.

      —

      moderator added code markdown around text; please don’t forget to use the </> button to mark example text as “code” so that characters don’t get changed by the forum

      JustinJudoJ 1 Reply Last reply Reply Quote 0
      • JustinJudoJ
        JustinJudo @JustinJudo
        last edited by JustinJudo

        I did some googling and found a RegEx solution:

        Find:

        \?.*$
        

        Replace with:
        (null)

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