title: Regular Expression to find a string included between two brackets
body: <p>I have a string </p>
  
  <pre><code>String a = "Hello my {name} , how are {{you}}, what should {{I}} {do}"
  </code></pre>
  
  <p>I want to get "name" and "{you}" "{I}" and "do"</p>
  
  <p>if there is a word between two brackets "{{}}" get the word include brackets
  if only one bracket, just get the word exclude bracket</p>
  
  <p>I tried with</p>
  
  <pre><code>    val pattern = "\\{(.*?)\\}".r
      pattern.replaceAllIn(valName, m =&gt; { // my condition } )
  </code></pre>
  
  <p>Only get the value if the word between 1 bracket {}, if two brackets {{}} the regex match with  <strong>{{}</strong>    </p>
  
  <p>please advise  </p>