这就是我所拥有的:
FirstName1 LastName2 [email protected] ID1
FirstName2 LastName2 [email protected] ID2
... and so on.
这就是我需要的:
[email protected] ID1
[email protected] ID2
... and so on.
正如标题所述,我想知道如何使用正则表达式实现上述结果。
答案1
- Ctrl+H
- 找什么:
^.*\h(\S+@.+)$
- 用。。。来代替:
$1
- 查看 环绕
- 查看 正则表达式
- 取消选中
. matches newline
- Replace all
解释:
^ # beginning of line
.* # 0 or more any character but newline
\h # 1 horizontal space
( # start group 1
\S+ # 1 or more non space character
@ # @
.+ # 1 or more any character but newline
) # end group
$ # end of line
替代品:
$1 # content of group 1
截图(之前):
截图(之后):