How do I replace characters in the middle of a string?
-
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.pngI 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.pngI 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.
-
Solved, realized how the brackets work, the solution is this: [_].*?[.]. Sorry!