问题
Notepad++ Search And Replace Multiple Text Lines
Example:
http://stackoverflow.com/123/xxxr423f3
http://stackoverflow.com/124/frwefr/4324324
http://stackoverflow.com/125/fwerf655446/432/4343
http://stackoverflow.com/140/fdsfdswfds
I only need http://stackoverflow.com/and numbers/
like
http://stackoverflow.com/123/
http://stackoverflow.com/124/
http://stackoverflow.com/125/
http://stackoverflow.com/140/
Thanks :)
回答1:
Please try this if it works:
Find: https://stackoverflow.com/((\d+)/).+
Replace: https://stackoverflow.com/\1
回答2:
You can use the Regular Expression search mode and search with a regular expression; something like this:
(http:\/\/stackoverflow\.com\/\d+\/).*?$
Replace with \1. Which means it will keep whatever is in the parentheses. .*?$ means to find any number of characters afterwards (until the end of the line), and remove them. Maybe this isn't exactly what you intend, but this should point you in the right direction.
来源:https://stackoverflow.com/questions/19305302/notepad-search-and-replace-multiple-text-lines