title: Scala regex match and split
body: <p>So here's what I want to do:</p>
  
  <p>input string: <code>"abc From: blah"</code>
  I want to split this so that the result is </p>
  
  <pre><code>["abc" "From: blah"] or ["abc" "From" "blah"
  </code></pre>
  
  <p>I have several other patterns to match
      <code>["abcd" "To:" "blah"]</code> etc</p>
  
  <p>So I have the following regex</p>
  
  <pre><code>val datePattern = """((.*&gt;.*)|(.*(On).*(wrote:)$)|(.*(Date):.*(\+\d\d\d\d)?$)|(.*(From):.*(\.com)?(\]|&gt;)?$))"""
  val reg = datePattern.r
  </code></pre>
  
  <p>If I do a match the result comes out fine.
  If I do a split on the same regex I get an empty list. </p>
  
  <pre><code>inputStr match {
        case reg(_*) =&gt; return "Match"
        case _ =&gt; return "Output: None"
  }
  </code></pre>
  
  <p>on the input string :</p>
  
  <pre><code>"abc From: blah blah"
  </code></pre>
  
  <p>returns Match</p>
  
  <p>Split </p>
  
  <pre><code>inputStr.split(datePattern)
  </code></pre>
  
  <p>returns an empty array. What am I possibly missing ?</p>