notepad++ 利用正则表达式实现插入功能 也就是替换自己

工作中会遇到正则表达式,大部分都是利用正则表达式查找出固定的词然后替换。但是有一下场景,查找出来的词,不能被其他词替换,要引用正则数据。
1.准备数据。查找在英文和中文之间插入一个Tab,也就是’\t’,经过试验得知,识别中文部分字段的正则表达为[^\x00-\xff](.*)

Table,view or cluster name表,视图或群集名称 
Column name列名 
Datatype of the column数据类型的列 
Datatype modifier of the column数据类型修饰符的栏 
Owner of the datatype of the column所有者数据类型的列 
Length of the column in bytes长度栏字节 
Length: decimal digits (NUMBER) or binary digits (FLOAT)长度:小数(号码)或二进制数字(浮法) 
Digits to right of decimal point in a number位数权利小数点在一些 
Does column allow NULL values?是否允许NULL值的列? 
Sequence number of the column as created序号栏的创建 
Length of default value for the column长度的默认值为柱 
Default value for the column默认值为柱 
The number of distinct values in the column一些独特的价值观念中的栏 
The low value in the column价值低栏 
The high value in the column高价值的栏 
The density of the column密度柱 
The number of nulls in the column空值的数量在列 
The number of buckets in histogram for the column水桶的数量在直方图栏 
The date of the most recent time this column was analyzed日期最近的时间,分析了此列 
The sample size used in analyzing this column样本大小分析中使用此栏 
Character set name字符集名称 
Declaration length of character type column宣言长度字符类型列 
Are the statistics calculated without merging underlying partitions?有统计数据计算,合并基本分区? 
Were the statistics entered directly by the user?有统计数据直接输入的用户? 
The average length of the column in bytes的平均长度为字节栏 
The maximum length of the column in characters最大长度的列中的字符 
C is maximum length given in characters,B if in bytes C是最大长度给予字符,如果在乙字节 
Is column data in 8.0 image format一列中的数据8.0图像格式? 
Has column data been upgraded to the latest type version format列数据已被升级到最新型的版本格式

如果把正则表达式表示为以下部分,notepad ++并不会把之前识别出来的字段查询出来,而是用正则表达式的文本给替换之前查找出来的值
在这里插入图片描述
2.解决方法
查找目标 :
[^\x00-\xff](.*)
替换为§:
\t\1
在这里插入图片描述
完美

上面的\1是代表引用上面查找出来的内容,另外还有\3是代表用前面一个字符替换,例如\t\3代表用\t替换上面查找出来的内容

另外,可以用()括起来你需要查找的内容,然后再替换那里用$引用。比如说,a123456789b。我a和b之间,b之前加上一个字符c,可以使用(a)(.*)(b)查找,用$1$2c$3替换即可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值