Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete all after last slash?

Tags:

notepad++

How to delete all after last /. I have a file with urls.

http://www.enworld.org/forum/member.php?1-Morrus&language=uk
http://weld.in.ua/forum/member.php/1-%D0%90%D0%B4%D0%BC%D0%B8%D0%BD?langid=5

Need a solution for notepad++

like image 660
broadbandninja Avatar asked Feb 07 '13 18:02

broadbandninja


1 Answers

Follow these steps:

  • Open your file in Notepad++.
  • Hit Ctrl+F.
  • To the Find what textbox, add Regular expression :[^/]+$
  • Keep the Replace with textbox empty(In screenshot that is my mouse cursor).
  • Be sure to check Regular Expression radio button at the bottom
  • Your Notepad++ dialog should look as below:

enter image description here

  • Click Replace All button.
  • You are done..!! Your final output will be as below:

    http://www.enworld.org/forum/

    http://weld.in.ua/forum/member.php/

Note :

Regular Expression [^/]+$ matches at least one of (anything not a slash) followed by end of the string:

like image 77
Bhushan Firake Avatar answered Oct 12 '22 05:10

Bhushan Firake