title: Regular Expression for NMAP match lines for Machine & OS only
body: <p>Using Linux, I'm looking for filter out the data for Machines that are only XP matches and delete consecutive, "nmap scan report for " lines.</p>
  
  <pre><code>Nmap scan report for 13.93.27.138
  445/tcp open  microsoft-ds Microsoft Windows XP microsoft-ds
  |   OS: Windows XP (Windows 2000 LAN Manager)
  Nmap scan report for 13.93.27.139
  Nmap scan report for 13.93.27.140
  Nmap scan report for 13.93.27.141
  Nmap scan report for 13.93.27.143
  445/tcp   open  microsoft-ds Microsoft Windows XP microsoft-ds
  Aggressive OS guesses: Microsoft Windows 2003 Small Business Server SP1 (91%), Microsoft Windows Server 2003 SP2 (91%), Microsoft Windows Server 2003 SP1 or SP2 (86%), Microsoft Windows XP Professional SP2 (French) (85%)
  |   OS: Windows XP (Windows 2000 LAN Manager)
  Nmap scan report for 13.93.27.144
  Nmap scan report for 13.93.27.147
  445/tcp   open  microsoft-ds Microsoft Windows XP microsoft-ds
  Aggressive OS guesses: Microsoft Windows 2003 Small Business Server SP1 (91%), Microsoft Windows Server 2003 SP2 (90%), Microsoft Windows XP Professional SP2 (French) (85%), Microsoft Windows Server 2003 SP1 or SP2 (85%)
  |   OS: Windows XP (Windows 2000 LAN Manager)
  Nmap scan report for 13.93.27.148
  OS: Windows XP (Windows 2000 LAN Manager)
  Nmap scan report for 13.93.27.191
  445/tcp   open  microsoft-ds Microsoft Windows XP microsoft-ds
  Aggressive OS guesses: Microsoft Windows 2003 Small Business Server SP1 (91%), Microsoft Windows Server 2003 SP2 (91%), Microsoft Windows Server 2003 SP1 or SP2 (86%), Microsoft Windows XP Professional SP2 (French) (85%)
  |   OS: Windows XP (Windows 2000 LAN Manager)
  Nmap scan report for 13.93.27.192
  OS details: Microsoft Windows 2000 SP2 - SP4, Windows XP SP2 - SP3, or Windows Server 2003 SP0 - SP2
  </code></pre>
  
  <p>Looking for a report that only shows:</p>
  
  <pre><code>Nmap scan report for 13.93.27.138
  OS: Windows XP (Windows 2000 LAN Manager)
  Nmap scan report for 13.93.27.147
  OS: Windows XP (Windows 2000 LAN Manager)
  </code></pre>
  
  <p>My idea was to use awk,grep, sed, or perl: m/^Nmap.<em>\n.</em>!(^Nmap).*/m
  Looking for the lines beginning with Nmap, and after the newline copy the next lines that are not beginning with Nmap, such as "OS: Windows XP". Then start again ...</p>
  
  <p>Thank you for the help :-)</p>