我有以下文字:
[email protected]:Golden-Ball
[email protected]:SilverBall
[email protected]:Copper_Ball
[email protected]:Encourage
[email protected]:Not-Engaged
我想要得到结果:
yahoo.com:Email.yahoo.com
epfedu.fr:Email.epfedu.fr
staplesnet.us:Email.staplesnet.us
mail.montclair.edu:Email.mail.montclair.edu
stu.howardcollege.edu:Email.stu.howardcollege.edu
我该怎么做?
答案1
答案2
- Ctrl+H
- 找什么:
^.+@([^:]+):.+$
- 用。。。来代替:
$1:Email.$1
- 查看 环绕
- 查看 正则表达式
- 取消选中
. matches newline
- Replace all
解释:
^ # beginning of line
.+ # 1 or more any character but newline
@ # literally @
([^:]+) # group 1, 1 or more any character that is not colon
: # a colon
.+ # 1 or more any character but newline
$
替代品:
$1 # content of group 1
: # a colon
Email # literally Email
. # a dot
$1 # content of group 1
截图(之前):
截图(之后):