How to delete all after last slash?

我是研究僧i 提交于 2019-12-20 11:06:32

问题


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++


回答1:


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:

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



来源:https://stackoverflow.com/questions/14758641/how-to-delete-all-after-last-slash

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!