如何删除记事本++中每一行的最后一部分?

kin*_*ing 8 notepad++

我知道这可以在记事本++中完成,但我没有找到正确的替换语法。

我想删除这句话的最后一部分,从?

http://sportnaslava.info/wiki/index.php?title=User:CisBlakeman861
Run Code Online (Sandbox Code Playgroud)

使其变为:

http://sportnaslava.info/wiki/index.php
Run Code Online (Sandbox Code Playgroud)

Put*_*nik 19

正则表达式是 \?.*$

\? mean question mark itself
.* mean everything else
$ means the end of line.
Run Code Online (Sandbox Code Playgroud)

所以我们搜索以问号开头并持续到行尾的内容。不要忘记将“搜索模式”设置为“正则表达式”

在此处输入图片说明


Jos*_*osh 5

http://lunar.earth.northwestern.edu/mediawiki/index.php/Limitless_It_the_film_high_quality
http://sportnaslava.info/wiki/index.php?title=User:CisBlakeman861
Run Code Online (Sandbox Code Playgroud)

使用这些示例,最好使用以下内容:

index\.php.*$
Run Code Online (Sandbox Code Playgroud)

然后替换为:

index.php
Run Code Online (Sandbox Code Playgroud)

这应该找到index.php之后(包括)的所有内容,并将其替换为index.php。

http://lunar.earth.northwestern.edu/mediawiki/index.php
http://sportnaslava.info/wiki/index.php
Run Code Online (Sandbox Code Playgroud)