title: Regex Match Until Word Contained in Array
body: <p>Using Ruby 1.8.7</p>
  
  <p>I need to grab everything up to a certain word - and I would like to match against words in an array. Example:</p>
  
  <pre><code>match_words = ['title','author','pages']
  item = "Title: Jurassic Park\n"
  item += "Author: Michael Crichton\n"
  
  if item =~ /title: (.*)#{match any word in match_words array}/i
    #do something here
  end
  </code></pre>
  
  <p>So, this would ideally return "Jurassic Park\n". I am currently matching on newlines but have found that the data I will be matching against might have newlines in strange places, like the middle of the sentence. So, I think matching to the next match_word would be a good idea.</p>
  
  <p>Is this possible, or maybe can be done another way?</p>