0
我有一個file.txt
,我想檢測第一次出現後第一次出現Report
。正則表達式python
我已經使用另一種方法做了這個,但我喜歡在Python中使用正則表達式。
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.236896000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.238663000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.240578000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.242551000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.244473000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.246256000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.248466000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.250880000 eth:ip:udp:adp
192.168.1.13 232.0.4.3 Apr 20, 2016 17:17:04.252270000 eth:ip:igmp Membership Report group 232.0.4.3
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.252680000 eth:ip:udp:data Source port: 49152 Destination port: aesop
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.254618000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.256553000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.258349000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.260234000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.262228000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.264001000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.265925000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.268151000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.270116000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.271854000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.273810000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.275996000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.278013000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.279936000 eth:ip:udp:data Source port: 49152 Destination port: aesop
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.281734000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.283952000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.285879000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.287654000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.289663000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.291609000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.293337000 eth:ip:udp:adp
193.253.155.253 232.0.4.2 Apr 20, 2016 17:17:04.295284000 eth:ip:udp:adp
請編輯您的問題,幷包括您嘗試使用的Python代碼。它工作嗎? – 2016-04-21 08:49:23