title: RegEx javascript text file
body: <p>I have an textfile with this structure: </p>
  
  <pre class="lang-none prettyprint-override"><code>06-05-13 21:52:10: Wence: Hey how you're doing?
  
  10-05-13 16:14:49: Wence: Everythings okay over here
  
  10-05-13 16:14:52: Wence: Nevermind, I just spoke to your mom and she told me you are fine.
  
  10-05-13 16:14:58: Wence: I'll host the bbq tonight. Would be fun if you came.
  </code></pre>
  
  <p>From this large string, I need to read the date, time, and message, but I need it in a key/value pair like this:</p>
  
  <pre><code>var message = {"Wence": "Hey how you're doing?", "Wence": "Everythings okay over here"}
  var time = {"Wence": "16:14:52", "Wence": "16:14:49"}
  var date = {"Wence": "10-05-13", "Wence": "10-05-13"}
  </code></pre>
  
  <p>I am using these RegEx patterns to find the message, date and time:</p>
  
  <pre><code>Date: /(\d{2})-(\d{2})-(\d{2})/
  Time: /(\d{2}):(\d{2}):(\d{2})/
  Name: /[A-z][0-9]\:/
  Message: (need to figure this out, don't know how to search for a string between patterns)
  </code></pre>
  
  <p>Strangely enough, when I'm trying to split these regex function like</p>
  
  <pre><code>var date = /(\d{2})-(\d{2})-(\d{2})/; 
  var dates = chat.split(date);
  </code></pre>
  
  <p>It doens't split the date in a way that I can save it in an Array.</p>
  
  <p>I splits it like "xx","xx","xx","rest of string","xx","xx","xx</p>
  
  <p>Any help on how to solve this problem and how to parse the message is highly appriciated. </p>