title: Regex selectively include separator
body: <p>I want to find strings between two regex patterns. The tricky part is that parts of the "before pattern" need to be included in the output string. </p>
  
  <p>Here is a simplified version of my code </p>
  
  <pre class="lang-py prettyprint-override"><code>import re
  start_pattern = "( StartString1 | StartString2 | StartString3ShouldBeIncluded | StartString4ShouldBeIncluded )"
  end_pattern = "( EndString1 | EndString2 )"
  joined_pattern = f'{start_pattern}(?P&lt;content&gt;.*?){end_pattern}'
  
  input1 = "...somejunk ... StartString1 THECONTENT EndString1 ...somejunk ... "
  output = re.search(joined_pattern, input1).group('content')
  print(output)  # Prints 'THECONTENT' which is what I want
  
  input2 = "...somejunk ... StartString3ShouldBeIncluded THECONTENT EndString2 ...somejunk ..."
  output = re.search(joined_pattern, input2).group('content')
  print(output)  # Prints 'THECONTENT' but I want 'StartString3ShouldBeIncluded THECONTENT'
  </code></pre>
  
  <p>Any way to change this regex to get the output I wish?</p>