title: Using regex to split text content into dictionary
body: <p>I have a text file that follows this format. </p>
  
  <blockquote>
    <p>LESTER HOLT (00:00:01): Breaking News Tonight: A deadly mass shooting
    at the airport. A gunman opens fire at baggage claim in Fort
    Lauderdale, witnesses describing scenes of sheer horror. A silent
    killer shooting people in the head as they tried to run and hide.
    Tonight, a storm of questions. Why did he do it? The suspect, a
    passenger with a firearm in his checked bag. New concerns about
    airport security before the checkpoint.</p>
    
    <p>(00:00:25): Also breaking tonight the new report from U.S.
    intelligence: Vladimir Putin himself ordered the effort to influence
    the election, aimed at hurting Clinton and helping Trump win. What the
    President-elect is saying after his top-secret briefing.</p>
    
    <p>(00:00:39): And States of Emergency: Millions from coast to coast
    paralyzed by a massive winter storm.</p>
    
    <p>(00:00:45): NIGHTLY NEWS begins right now.</p>
  </blockquote>
  
  <p>I am trying to parse this information into a Python Dictionary, where the speaker is a dictionary, of dictionaries, which has timecode keys, and the content is the value, I can't consistently split because of potential information before the timecode, (IE the first quote), as well as the fact that the split character <code>:</code> is also a character involved with the timecode itself <code>00:00:00</code>.</p>
  
  <p>Trying to split according to the regex.</p>
  
  <pre><code>for line in msg.get_payload().split('\n'):
      regex = r'\d{2}:\d{2}:\d{2}'
      test = re.split(regex, line)
      print(test)
      sleep(1)
  </code></pre>
  
  <p>Appears to work in splitting it properly, but it causes me to lose the value I am splitting on (timecode), which I intend to use as a key. How can I properly split the above content, get the speaker, and then get the timecode as a key, and the content as a value.It is possible he may be present later in the text as well, and it should append to the list of timecodes./ </p>
  
  <p>The output format I am targeting is something along the lines of</p>
  
  <pre><code>{speakers:{'Lester Holt': {'00:00:01':content..., '00:00:0025': content...},
  'speaker2':{etc,etc,etc} }}
  </code></pre>
  
  <p>Ive tried using the split as mentioned above, but it removes my timecode variable. </p>
  
  <p>Any thoughts and guidance is appreciated. </p>