How to match a method block using regex?
<p>Take an example.</p>

<pre><code> public static FieldsConfig getFieldsConfig(){
    if(xxx) {
      sssss;
    }
   return;
}
</code></pre>

<p>I write a regex, <code>"\\s*public\\s*static.*getFieldsConfig\\(.*\\)\\s*\\{"</code></p>

<p>It can match only the first line. But how to match right to the last "}" of the method? </p>

<p>Help me.  Thanks.</p>

<p>Edit:
The content of method {} is not specified. But pattern is surely like this, </p>

<pre><code>  public static xxx theKnownMethodName(xxxx) {
    xxxxxxx
  }
</code></pre>