title: awk regex for nested big brackets
body: <p>I have a structure like this:</p>
  
  <pre><code>label1 {
     label1_1 {
  
        item1_1_1: "value1_1_1";
        label1_1_2:{ item1_1_2_1: "value1_1_2_1";};
  
        item1_1_3: "value1_1_3";
     };
  
     label1_2 {...};
     ...
  };
  
  label2 {
     item2_1: "value2_1";
     label2_1:{
        item2_1_1: "value2_1_1";
        ...
     };
  };
  </code></pre>
  
  <p>The section could be in one line or multiple lines, and empty line presentable. I'm trying to use awk to get any section with given label name, </p>
  
  <pre><code>section=$(awk -v RS='' -v ORS='\n\n' "/($2)\s(\{([^{}]|(?R)|\n)*\})/" $1)
  </code></pre>
  
  <p>where the $1 is file name, $2 is label name. It works if happens no empty line in the section, for example "label2", but faild by others.</p>
  
  <p>What's the correct regex I should use?</p>