title: Trying to extract values from text -
body: <p>I am trying to get <em>acc</em>, <em>accel</em> and <em>rx</em> from below text only if <strong><em>accounting</em></strong> value is true.</p>
  
  <pre><code>dataRx:       21916               drx:      1743625
    ota:      191791                orx:      74164489
    dataDropped:  14                    dropped:1134
    id: 65535 waitress BE     nginxid: 0   kbps:  0.000
          accounting: false
          drop : 1
          rx   :  48392          bytes: 483920
    id: 65533 waitress BE     nginxid: 1   kbps:  0.000
          accounting: false
          drop : 4
          rx   :  122914         bytes: 70081939
    id: 4232  nginx BE     nginxid: 3   kbps:  0.000
          accounting: false
          drop : 0
          rx   :  3084           bytes: 94357
    id: 10482 server   BE     nginxid: 4   kbps:  0.000
          accounting: false
          drop : 0
          rx   :  15             bytes: 2477
    id: 20344 serve  BE     nginxid: 10  kbps:  62914.560
          accounting: true
          drop : 2
          rx   :  2217           bytes: 309637
          accel : 482            bytes: 264318
          acc :349               bytes: 225181
  </code></pre>
  
  <p>Below python code gets <em>accounting</em> and <em>accel</em> values using below regex</p>
  
  <pre><code>accounting:\s*((?P&lt;accounting&gt;\S*)[\S\s]*?accel:[\S\s]*?bytes:\s*(?P&lt;accel&gt;\S*)[\S\s]*?)
  
  
  for match in re.finditer(re_exp, text):
      group = match.groupdict()
      print group
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>{"accounting": false, "accel": 264318}
  </code></pre>
  
  <p>But, the expected output should be </p>
  
  <pre><code>{"accounting": true, "accel": 264318}
  </code></pre>
  
  <p>Need help with regex expression. Any help would be greatly appreciated.
  Also, is there a regex way to group all the data fields under <em>id</em>?</p>
  
  <p>Thanks</p>