title: Python regex to match word before <
body: <p>So I want to match something like this -</p>
  
  <pre><code>foo &lt;TEST&gt;something something &lt;/TEST&gt; blah
  </code></pre>
  
  <p>I want a regex that gets me the foo, but does not get me the something. I was thinking of using a regex that was something like this</p>
  
  <pre><code>(\w\s)&lt;
  </code></pre>
  
  <p>with a negative lookahead, but I'm not sure how to use that in this case.</p>
  
  <p>OTHER CASES-</p>
  
  <pre><code>something something foo &lt;TEST&gt; something something &lt;/TEST&gt; blah 
  </code></pre>