正则表达式中,如何在任意匹配字符后面加上原字符和特定内容
数据的中间,时间格式上没有秒,
10.7.98.204,10.4.177.5,wb_gh017,2018/7/1 23:58,00-71-C2-0D-D3-BA,1
10.7.98.204,10.4.177.5,wb_gh017,2018/7/1 23:58,00-71-C2-0D-D3-BA,0
10.7.21.148,10.7.31.143,shenzhen,2018/7/1 23:57,00-05-9A-3C-7A-00,0
10.7.82.28,192.168.22.4,panwei,2018/7/1 23:57,00-00-00-00-00-00,0
10.7.98.207,10.6.125.74,shenlijia,2018/7/1 23:56,44-37-E6-83-F2-42,0
10.7.98.206,192.168.116.54,mozihong,2018/7/1 23:57,00-00-00-00-00-00,0
要替换为时分秒的格式
10.7.98.204,10.4.177.5,wb_gh017,2018/7/1 23:58:00,00-71-C2-0D-D3-BA,1
10.7.98.204,10.4.177.5,wb_gh017,2018/7/1 23:58:00,00-71-C2-0D-D3-BA,0
10.7.21.148,10.7.31.143,shenzhen,2018/7/1 23:57:00,00-05-9A-3C-7A-00,0
10.7.82.28,192.168.22.4,panwei,2018/7/1 23:57:00,00-00-00-00-00-00,0
10.7.98.207,10.6.125.74,shenlijia,2018/7/1 23:56:00,44-37-E6-83-F2-42,0
10.7.98.206,192.168.116.54,mozihong,2018/7/1 23:57:00,00-00-00-00-00-00,0
用notepad++正则替换
(\d\d\:\d\d)
替换为
\1\:00
在正则表达式中,放在圆括号中的是分组,按括号出现顺序可用\1,\2...\9(或$1,$2...$9)引用整个正则用\0或$0引用。
因此 替换中\1引用了括号中匹配的内容,然后加上要添加的字符
EverEdit中要用
$1