• Login
Community
  • Login

Find & Replace question with RegEx solution

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
2 Posts 1 Posters 381 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.
  • J
    JustinJudo
    last edited by PeterJones Nov 15, 2023, 11:28 PM May 2, 2023, 10:42 PM

    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

    J 1 Reply Last reply May 2, 2023, 11:10 PM Reply Quote 0
    • J
      JustinJudo @JustinJudo
      last edited by JustinJudo May 2, 2023, 11:21 PM May 2, 2023, 11:10 PM

      I did some googling and found a RegEx solution:

      Find:

      \?.*$
      

      Replace with:
      (null)

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