• Login
Community
  • Login

How do I replace characters in the middle of a string?

Scheduled Pinned Locked Moved General Discussion
replacemiddleofstrin
2 Posts 1 Posters 713 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.
  • A
    Adam Yik
    last edited by Jun 16, 2019, 2:09 AM

    How do I replace a character/a group of characters in each line? For example:
    https://www.example.com/images/asdfuisdhfaskehtiohgs_50.png
    https://www.example.com/images/sdfjksaldfjalsjdkdddd_20.jpg
    https://www.example.com/images/shgrfjkcviofreavcdfsd_600.jpg
    https://www.example.com/images/disolkhrewiousdfuoidd_400.png

    I want it replace it with:
    https://www.example.com/images/asdfuisdhfaskehtiohgs_1280.png
    https://www.example.com/images/sdfjksaldfjalsjdkdddd_1280.jpg
    https://www.example.com/images/shgrfjkcviofreavcdfsd_1280.jpg
    https://www.example.com/images/disolkhrewiousdfuoidd_1280.png

    I want to replace any amount of digits without replacing “_” and anything before it and I do not want to overwrite anything after the dot “.”. I want to replace something in between it (the numbers).

    And I do not know how to use the regular expressions for replacing something that is next to a character I do not want to replace.

    1 Reply Last reply Reply Quote 0
    • A
      Adam Yik
      last edited by Adam Yik Jun 16, 2019, 2:45 AM Jun 16, 2019, 2:42 AM

      Solved, realized how the brackets work, the solution is this: [_].*?[.]. Sorry!

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