问题描述
example-site1.com site-site1.com user1 password1
example-site2.com site-site2.com user2 password2
example-site3.com site-site3.com user3 password3
我需要安排这样的单词:
example-site1.com:80@user1@password1
example-site2.com:80@user2@password2
example-site3.com:80@user3@password3
有人可以帮我吗?
谢谢。
解决方法
- Ctrl + H
- 查找内容:
^(\S+)\h+\S+\h+(\S+)\h+(\S+)
- 替换为:
$1:80@$2@$3
- 检查 环绕
- 检查 正则表达式
- 全部替换
说明:
^ # beginning of line
(\S+) # group 1,1 or more non spaces (domain)
\h+ # 1 or more horizontal spaces
\S+ # 1 or more non spaces
\h+ # 1 or more horizontal spaces
(\S+) # group 2,1 or more non spaces (user)
\h+ # 1 or more horizontal spaces
(\S+) # group 3,1 or more non spaces (password)
替换:
$1 # content of group 1
:80@ # literally :80@
$2 # content of group 2
@ # literally @
$3 # content of group 3
屏幕截图(之前):
屏幕截图(之后):