如何删除第二栏记事本++?

问题描述

我有这个文件

example-site1.com      site-site1.com     user1    password1
example-site2.com   site-site2.com    user2    password2
example-site3.com      site-site3.com    user3    password3

有不规则的空格,我想在站点后面添加端口 80 @ 字符

我需要安排这样的单词:

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

屏幕截图(之前):

enter image description here

屏幕截图(之后):

enter image description here

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...