title: Ruby one-liner to capture regular expression matches
body: <p>In Perl, I use the following one line statements to pull matches out of a string via regular expressions and assign them. This one finds a single match and assigns it to a string:</p>
  
  <pre><code>my $string = "the quick brown fox jumps over the lazy dog.";
  
  my $extractString = ($string =~ m{fox (.*?) dog})[0];
  </code></pre>
  
  <p>Result: <code>$extractString == 'jumps over the lazy'</code></p>
  
  <p>And this one creates an array from multiple matches:</p>
  
  <pre><code>my $string = "the quick brown fox jumps over the lazy dog.";
  
  my @extractArray = $string =~ m{the (.*?) fox .*?the (.*?) dog};
  </code></pre>
  
  <p>Result: <code>@extractArray == ['quick brown', 'lazy']</code></p>
  
  <p>Is there an equivalent way to create these one-liners in Ruby?</p>