0

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 :)

DanyBoss
  • 3
  • 1
  • 2

2 Answers2

1

Please try this if it works:

Find: https://stackoverflow.com/((\d+)/).+

Replace: https://stackoverflow.com/\1

Community
  • 1
  • 1
demo.b
  • 3,299
  • 2
  • 29
  • 29
  • `http://stackoverflow.com/category/news/love1/fjref?WT.ac=category_thumb&W` or `http://stackoverflow.com/category/news/love1/xx434?WT.ac=category_thumb&W` i need only http://stackoverflow.com/category/news/love1/ **the code?WT** I hope I explained well – DanyBoss Oct 10 '13 at 20:56
0

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. enter image description here

bozdoz
  • 12,550
  • 7
  • 67
  • 96
  • `http://stackoverflow.com/123??xxxr423f3` Is working how you say but can you please tell me how can i delete all text after ?? – DanyBoss Oct 10 '13 at 20:48