我正在尝试将主机与此文件分开,但我的正则表达式同时选择了两个主机:
timestamps|||scan_start|Tue May 1 23:00:29 2012|timestamps||foo.com|host_start|Tue May 1 23:16:51 2012|results|-0017\ntimestamps||foo.com|host_end|Tue May 1 23:19:17 2012|timestamps||bar.com|host_start|Tue May 1 23:24:31 2012|results|general/tcp|Sendmail 8.13.8\n\n\ntimestamps||bar.com|host_end|Tue May 1 23:29:11 2012|timestamps|||scan_end|Wed May 2 00:19:40 2012|
正则表达式:
timestamps\|\|[\w,\.]*\|host_start.*host_end