【发布时间】:2021-01-30 03:25:34
【问题描述】:
我想知道如何在 Notepad++ 中删除 IP 地址和端口之前和之后的所有内容。例如,从此:
email:pass | ip = 139.224.45.151 | port = 8080 | protocol = http | country = CN
email:pass | ip = 102.67.68.1 | port = 1080 | protocol = socks4 | country = ZZ
email:pass | ip = 94.54.211.197 | port = 80 | protocol = http | country = TR
email:pass | ip = 161.97.138.241 | port = 3128 | protocol = http | country = US
..到这个
139.224.45.151:8080
102.67.68.1:1080
94.54.211.197:80
161.97.138.241:3128
【问题讨论】:
-
将
^.*ip\s*=\s*(\d{1,3}(?:\.\d{1,3}){3})\s*\|\s*port\s*=\s*(\d+).*$替换为\1:\2。