问题
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 whattextbox, add Regular expression :[^/]+$ - Keep the
Replace withtextbox empty(In screenshot that is my mouse cursor). - Be sure to check
Regular Expressionradio button at the bottom - Your Notepad++ dialog should look as below:
- Click
Replace Allbutton. 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