title: How to I write a regular expression in Python 2.7 to return two words in a string with an underscore between them
body: <p>I have strings consistent with this example:</p>
  
  <pre><code>&gt;&gt;&gt; s = "plant yard !!@ blah HELLO OS=puffin_CuteDeer_cat_anteater"
  </code></pre>
  
  <p>Every string has the "OS=" expression and its latter part comprises words linked by underscores. The first part of the string up to "OS=" and the actual words linked by underscores differ among strings. </p>
  
  <p>I want to write a regular expression with the 're' module to ignore the first part of the string up to the  pattern part, and then return the first two words within that pattern maintaining the underscore between them. </p>
  
  <p>I want:</p>
  
  <pre><code>&gt;&gt;&gt; 'puffin_CuteDeer'
  </code></pre>
  
  <p>I can get rid of the first part, and am getting close (I think) to handling the  pattern part. Here's what I have and what it returns: </p>
  
  <pre><code>&gt;&gt;&gt; example = re.search('(?&lt;=OS=)(.*(?=_))',s)
  &gt;&gt;&gt; example.group(0)
  &gt;&gt;&gt; 'puffin_CuteDeer_cat'
  </code></pre>
  
  <p>I have tried many, many different possibilities and none of them are working. </p>
  
  <p>I was surprised that </p>
  
  <pre><code>&gt;&gt;&gt; example = re.search('(?&lt;=OS=)(.*(?=_){2})',s)
  </code></pre>
  
  <p>did not work.</p>
  
  <p>Your help is sincerely appreciated. </p>
  
  <p>Update: I realize that there are non-regex ways of obtaining the desired output. However, for reasons that are probably beyond the scope of the question, I think regex is the best choice for me. </p>