([a-z0-9]{1,4}:+){3,5}[a-z0-9]{1,4}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3
} 几乎可以匹配所有的IP地址(v4和v6),但不幸的是,对于下面的文本和类似的文本,它也会选中粗体字段:
from mail.example.com (example.com. [213.239.250.131]) by mx.google.com with ESMTPS id xc4si15480310lbb.82.2014.10.26.06.16.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Oct 2014 06:16:58 -0700 (PDT)
Received: from ssservices1-1 (192.168.20.142) by mail.supershuttle.com (192.168.20.110) with Microsoft SMTP Server id 14.2.347.0; Tue, 21 Apr 2015
Received: from ssservices1-1 (192.168.20.142) by mail.supershuttle.com (192.168.20.110) with Microsoft SMTP (TLS) Server id 14.2.347.0; Tue, 21 Apr 2015
Received: from plug.mysitehosted.com (plug.mysitehosted.com [10.248.1.153]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.0.19); Tue, 11 Mar 2014 06:14:03 GMT
有什么最好的方法(我将使用Python)来省略这些匹配?其中两个前面有文本“id”,尽管在第一个案例中,并不是直接在其前面。