title: Searching Ruby Arrays with Regex expressions
body: <p>Hi I have small ruby function that splits out a Ruby array as follows:-</p>
  
  <pre><code>def rearrange arr,from,to
    sidx = arr.index from
    eidx = arr.index to
    arr[sidx] = arr[sidx+1..eidx]
  end
  
  arr= ["Red", "Green", "Blue", "Yellow", "Cyan", "Magenta", "Orange", "Purple", "Pink",    "White", "Black"]
  start = "Yellow"
  stop = "Orange"
  
  rearrange arr,start,stop
  puts arr.inspect
  #=&gt; ["Red", "Green", "Blue", ["Cyan", "Magenta", "Orange"], "Cyan", "Magenta", "Orange", "Purple", "Pink", "White", "Black"]
  </code></pre>
  
  <p>I need use use a regex expression in my start and stop searches e.g. </p>
  
  <p>Start = "/Yell/"</p>
  
  <p>Stop = "/Ora/"</p>
  
  <p>Is there an easy way yo do this in Ruby?</p>