title: I need a regex to match puppet facter facts
body: <p>Puppet facts look like this:</p>
  
  <pre><code>processors =&gt; {"models"=&gt;["AMD Opteron(tm) Processor 6172", "AMD Opteron(tm) Processor 6172", "AMD Opteron(tm) Processor 6172", "AMD Opteron(tm) Processor 6172"], "count"=&gt;4, "physicalcount"=&gt;2}
  productname =&gt; VMware Virtual Platform
  ps =&gt; ps -ef
  puppetversion =&gt; 3.6.2
  rubysitedir =&gt; /usr/local/brs/harmony-puppet/lib/ruby/site_ruby/2.1.0
  rubyversion =&gt; 2.1.2
  sshecdsakey =&gt; AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNDUmg8FQGCO/r/VGABUPwBqT8zTwzXwZCjTdBC6cXj1Mo5ypxuqO1Qtwg9uQagcS5eLNbv+SxHotpzYSXZ1R8g=
  sshfp_dsa =&gt; SSHFP 2 1 42ffbd293f1501c0718b2b7b3852542329da1758
  SSHFP 2 2 eb52d78a34bdadecc41b38366a5580c923bbb6cd0b81cec76de6379ce4251439
  sshfp_ecdsa =&gt; SSHFP 3 1 d41abd2e3aff846b4efb59dbc8e4803875d33130
  SSHFP 3 2 ae77a20a66859976e06efb7d6dd0819db4f9e9d93bc55da52a4bffff6acb1baa
  sshfp_rsa =&gt; SSHFP 1 1 d3f14587683138e6d10cacba92fa34364ed5d326
  SSHFP 1 2 132856925e056d02767e6c6ca4015ed21ac4c6eddb727f7c69e5edecb8806884
  sshrsakey =&gt; AAAAB3NzaC1yc2EAAAADAQABAAABAQDzcJ6158aIkY161vcDH6WKNgKAeUsxrHh+HJH9IEistcV2TUJSdHtG/p5peI+cTa0EhabbNw8ToUU3ZWYmiTmxxuZzxggAxCx6xhWNDgC/492QnouxHnqjxwpFyIYnLpdbaMRV/6t9iE7v09Gfb31TS3/DbAUh5yla1OOeHbxJQ/eUOUYgy7/6eFL43+R9SfiuP11VRK8r325mCOFaPqw8VuNeGul/rMnccBCbuFvgmQnfOo/ldwrfOL2W4qAvfE0bKyG13WrDSlauo+CFtYqDK08hCItjrbVKgVrOzLCuKGzKFuqOgF3u8Q1je23qu7eUmF7lZPYVWSEpkh0xlR0p
  swapfree =&gt; 1.45 GB
  swapfree_mb =&gt; 1482.82
  swapsize =&gt; 1.46 GB
  swapsize_mb =&gt; 1497.00
  system_uptime =&gt; {"seconds"=&gt;6034301, "hours"=&gt;1676, "days"=&gt;69, "uptime"=&gt;"69 days"}
  timezone =&gt; PDT
  </code></pre>
  
  <p>I am trying to easily split each fact up into a key/value pair.  Using this site:</p>
  
  <p><a href="http://rubular.com/" rel="nofollow">http://rubular.com/</a></p>
  
  <p>And this regex</p>
  
  <pre><code>(?m)^(\S+) =&gt; (((?!^\S+ =&gt; ).)*)$
  </code></pre>
  
  <p>I am able to get what I want (all the keys and values match perfectly).  The problem is I'm writing my code in java, and using this site:</p>
  
  <p><a href="http://java-regex-tester.appspot.com/" rel="nofollow">http://java-regex-tester.appspot.com/</a></p>
  
  <p>With the same inputs I am not getting the matches I want.  Specifically the facts where the value of the key/value pair contains a newline character, such as this one:</p>
  
  <pre><code>sshfp_rsa =&gt; SSHFP 1 1 d3f14587683138e6d10cacba92fa34364ed5d326
  SSHFP 1 2 132856925e056d02767e6c6ca4015ed21ac4c6eddb727f7c69e5edecb8806884
  </code></pre>
  
  <p>End up omitting the second line of the value:</p>
  
  <pre><code>key = sshfp_rsa
  value = SSHFP 1 1 d3f14587683138e6d10cacba92fa34364ed5d326
  </code></pre>
  
  <p>Can anyone help me building the correct regex?</p>