How to delete all after last slash?

后端 未结 1 459
庸人自扰
庸人自扰 2021-02-04 16:26

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-%D         


        
1条回答
  •  生来不讨喜
    2021-02-04 16:42

    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:

    0 讨论(0)
提交回复
热议问题