title: Regex to match strings within braces
body: <p>I am trying to write a regex to a string that has the following format </p>
  
  <p><strong>12740(34,12) [abc (a1b2c3) (a2b3c4)......] myId123</strong></p>
  
  <p>Currently, I have something like this</p>
  
  <pre><code>\((?P&lt;expression&gt;\S+)\)
  </code></pre>
  
  <p>But with this, I can capture only the strings within square brackets. </p>
  
  <p>Is there anyway I can capture the integers before the square brackets and also id at the end along with the strings within square brackets.</p>
  
  <p>The number of strings enclosed within small brackets will not be the same. I could also have a string that looks like this</p>
  
  <p><strong>10(3,2) [abc (a1b2c3)] myId1</strong> </p>
  
  <p>I know that I can write a simple regex for the above expression using brute force. But could anyone please help me write one when the number of strings within the square bracket keeps changing.</p>
  
  <p>Thanks in advance</p>