title: How to match regex with conditions?
body: <p><strong>&quot;Fingerprint (rear-mounted, region dependent), accelerometer, proximity&quot;</strong></p>
  <p>Above is the string of <strong>sensors</strong> in a device. I'm trying to match every sensor. The problem is that when I match above using <code>/.+?,/g</code>, The matches are:</p>
  <ol>
  <li>Fingerprint (rear-mounted,</li>
  <li>region dependent),</li>
  <li>accelerometer,</li>
  <li>proximity</li>
  </ol>
  <p>I'm getting 4 sensors here instead of three. Because, of course, my pattern matches these. What I want to do is that when a <code>,</code> is preceded by <code>(</code>, then I want to match <code>),</code> and when not preceded by <code>(</code>, I want to match <code>,</code></p>
  <p>I think I need to use lookarounds here. But I can't get them to work for me. I tried multiple regexes. It's silly to paste them all here :)</p>
  <p><em>I'm using JavaScript</em></p>