title: Python - Replace text before first occurrence of string?
body: <p>So if I have a string like: </p>
  
  <pre><code>plz_work = "text I want to get rid of HELLO want to keep this text HELLO want to keep this text"
  </code></pre>
  
  <p>I want to remove all the text before the first instance of <code>HELLO</code>, like the following: </p>
  
  <pre><code>"HELLO want to keep this text HELLO want to keep this text"
  </code></pre>
  
  <p>In this case, I used regex, and tried the following off of <a href="https://stackoverflow.com/questions/30945784/how-to-remove-all-characters-before-a-specific-character-in-python">this</a> and <a href="https://stackoverflow.com/questions/3951660/how-to-replace-the-first-occurrence-of-a-regular-expression-in-python">this</a>: </p>
  
  <pre><code> re.sub(r'.*HELLO','HELLO',plz_work,1)
  </code></pre>
  
  <p>But I get this: </p>
  
  <pre><code>'HELLO want to keep this text'
  </code></pre>
  
  <p>Why does this happen? I thought the last parameter signified <a href="https://docs.python.org/3/library/re.html#re.sub" rel="nofollow noreferrer">count</a> and means that it would only perform 1 substitution... why is it going wrong here? Any help would be greatly appreciated, thanks!! </p>