title: Regex for matching everything inside a function curly braces
body: <p>I've found a lot of regex examples for matching content within nested brackets, but what I want to do is match:</p>
  
  <ul>
  <li>a function with a particular name</li>
  <li>match ALL content inside the curly braces (including any NESTED curly braces)</li>
  </ul>
  
  <p>For example:</p>
  
  <pre><code>function someFunc() {
    const a = 6;
  
    if (a === 7) {
      while (true) {
        break;
      }
    }
  }
  </code></pre>
  
  <p>This should find <code>function someFunc</code>+ignore anything up to first curly+then match all contents within the curly braces, including any nested braces.</p>
  
  <p>I'm a noob at regex so I can't show you what I've done, I've been looking at <a href="https://stackoverflow.com/questions/413071/regex-to-get-string-between-curly-braces-i-want-whats-between-the-curly-brace">Regex to get string between curly braces &quot;{I want what&#39;s between the curly braces}&quot;</a> but none of them are suitable. Thanks!</p>
  
  <p>PS expected output is a capture group of all contents within a function (which I can then replace).</p>