3
我与这个字符串正则表达式:独立结肠逗号(IP:PORT)
date,time,mac_address,source_ip:source_port,dst_ip:dst_port,method,url
2017-04-01,00:01:03,00:10:f3:3f:fe:f2,192.168.2.62:28741,172.20.0:80,GET,http://www.website.com
转换为
2017-04-01,00:01:03,00:10:f3:3f:fe:f2,192.168.2.62,28741,172.20.0,80,GET,http://www.website.com
挣扎(分离IP:端口)几个小时,但我想不出出来!尝试像(?:\.\d+)(?<=\d)\:
正则表达式,但它不起作用。
我想使用powershell -replace
运算符。
'\ d + \ \ d + \ \ d + \ \ d +(:)\ d +'匹配。 (并捕获)IP和端口之间的':'。这有帮助吗? – Maroun
@WiktorStribiżew我试过,因为文本文件是大型的日志文件,它使这个过程更长! – HBS
@MarounMaroun在powershell中,它匹配所有ip:port,我不能使用替换运算符 – HBS