我有以下文字:
[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
截圖(之前):
截圖(之後):