Notepad++ Newbie - How to delete everything after

2019-09-19 01:30发布

问题:

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


标签: notepad++