title: Tuples from string by regular expressions in Scala
body: <p>I have string like <code>{param1=foo}{param2=bar}hello world!</code><br>
  I need to extract array of tuples <strong>(paramName, value)</strong> from this string and get something like <code>[(param1, foo), (param2, bar)]</code></p>
  
  <p>Is it possible in Scala to extract this tuples by only one regex? Because I managed to do this only in way like</p>
  
  <pre class="lang-scala prettyprint-override"><code>val str = "{param1=foo}{param2=bar}hello world!"
  val param = """(?&lt;=\{)(.+?)(?=\})""".r // extract everything between { and }
  val keyValue = """(.+)=(.+)""".r // for extracting key and value
  val parameters = for (keyValue(key,value) &lt;- param.findAllIn(str).toArray) 
                       yield (key,value)
  </code></pre>
  
  <p>And it doesn't look sweet.</p>
  
  <p>Also I tried to use</p>
  
  <pre class="lang-scala prettyprint-override"><code>val param = """(?&lt;=\{)(.+?)=(.+?)(?=\})""".r
  </code></pre>
  
  <p>But it return <code>param=value</code> as one string</p>