title: Match text before colon/hypen
body: <p>I have strings that can be in following format:</p>
  
  <ul>
  <li>A: B: C</li>
  <li>A - B - C</li>
  <li>A - B: C</li>
  <li>A: B - C</li>
  </ul>
  
  <p>In all cases, I need to extract everything until <code>B</code>, including the colon/hypen and the space following it, so for the examples, that would be following:</p>
  
  <ul>
  <li>A: </li>
  <li>A -</li>
  <li>A -</li>
  <li>A: </li>
  </ul>
  
  <hr>
  
  <p>For example 1, <code>^[^:]*:\s*</code> would work</p>
  
  <p>For example 2, <code>^[^-]*-\s*</code> would work</p>
  
  <p>For example 1, 2 and 3, <code>^([^-]*-|[^:]*:)\s*</code> would work</p>
  
  <p>I would like something that would give me the desired match for all examples.</p>