Notepad++ Newbie - How to delete everything after a specific word?

人走茶凉 提交于 2020-01-06 15:58:13

问题


I have a list in notepad++ with about 296 lines on it. How can i delete everything after inactive? When i try on my own it finds all instances of inactive.

This is what it looks like originally for an example:

access-list 101 permit ip 192.168.10.0 0.0.0.255 inactive (hx0000) (123456789) blahblahblah (inactive)

I need it to look like this:

access-list 101 permit ip 192.168.10.0 0.0.0.255 inactive

Question 2: If for example i wanted to only delete (hx0000) including the parenthesis how would i do this as well? When i try it deletes the text, but makes the output look like this: ()

Thanks in advance everyone!!!


回答1:


If you want to delete everything after the first occurrence of inactive, you can try the following find and replace:

Find:

inactive.*

Replace:

inactive


来源:https://stackoverflow.com/questions/41947674/notepad-newbie-how-to-delete-everything-after-a-specific-word

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