title: Extract string in regex
body: <p>im kinda new to Ruby but i have a question to regex in Ruby.</p>
  
  <p>I have a String and i want to save the number in the string in a new variable and just the number.
  ruby is a pink to blood-red colored gemstone, a variety8of the mineral corundum (aluminium oxide). 
  My Text ist</p>
  
  <pre><code>ruby is a pink to blood-red colored gemstone, a variety8of the mineral corundum (aluminium oxide). 
  </code></pre>
  
  <p>My regular expression is: </p>
  
  <pre><code>/blood-red colored gemstone, a variety(.*?)of the mineral corundum/m
  </code></pre>
  
  <p>Now i want to save the result in a new variable. So lets say:</p>
  
  <pre><code>var1 = 'ruby is a pink to blood-red colored gemstone, a variety8of the mineral corundum (aluminium oxide).'
  </code></pre>
  
  <p>and</p>
  
  <pre><code>var2 = var1[/blood-red colored gemstone, a variety(.*?)of the mineral corundum/m]
  </code></pre>
  
  <p>Now the result is the whole sentence from blood-red ... to ... mineral corundum.
  but how can i get access to the middle without the borders. In Rubular it is shown as a "group" ( in my case i want access to the digit inside a sentence). How can i get access to this group?</p>
  
  <p>You can watch my example here in Rubular <a href="http://rubular.com/r/PgAgwRw3a5" rel="nofollow">http://rubular.com/r/PgAgwRw3a5</a></p>
  
  <p>Thank you very much</p>