例如我有:
hello I am ...
For the reason ...
Not sure if ...
Run Code Online (Sandbox Code Playgroud)
我想保留hello和For并Not摆脱记事本++中每一行中的其余部分。
找:
^([^\s]*)\s.*$
Run Code Online (Sandbox Code Playgroud)
代替:
\1
Run Code Online (Sandbox Code Playgroud)
解释:
^ start of line
([^\s]*) match and capture every non whitespace character up until
\s the first whitespace character
.* consume remainder of line until reaching the
$ end of line
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6764 次 |
| 最近记录: |