如何在正则表达式上改变质量

时间:2015-03-03 10:54:03

标签: regex

之前:

LIVE | 98.183.227.191:24435 | 0.31 | Virginia | 23517 | ip98-183-227-191.hr.hr.cox.net | United States | Blacklist: No | Checked at http://dichvusocks.us
LIVE | 72.167.179.75:60088 | 1.66 | Arizona | 85260 | ip-50-63-58-100.ip.secureserver.net | United States | Blacklist: No | Checked at http://dichvusocks.us
LIVE | 79.127.124.115:1080 | 1.59 | Unknow | Unknow | 79.127.124.115 | Iran, Islamic Republic of | Blacklist: Yes | Checked at http://dichvusocks.us
LIVE | 89.36.166.204:60088 | 1.68 | Cluj | Unknow | vps.ironmedia.ro | Romania | Blacklist: No | Checked at http://dichvusocks.us

98.183.227.191:24435
72.167.179.75:60088
79.127.124.115:1080
89.36.166.204:60088

如何在Regex上进行大规模清理?

1 个答案:

答案 0 :(得分:0)

使用以下正则表达式,然后将匹配替换为\1

^[^|]*\|\s*(\S+).*

OR

^[^|]*\|\s*([^|]*?)\s*\|.*

DEMO