title: Returning all characters before the first underscore
body: <p>Using <code>re</code> in Python, I would like to return all of the characters in a string that precede the first appearance of an underscore. In addition, I would like the string that is being returned to be in all uppercase and <strong>without</strong> any non-alpanumeric characters.</p>
  
  <p>For example:</p>
  
  <pre><code>AG.av08_binloop_v6 = AGAV08
  TL.av1_binloopv2   = TLAV1
  </code></pre>
  
  <p>I am pretty sure I know how to return a string in all uppercase using <code>string.upper()</code> but I'm sure there are several ways to remove the <code>.</code> efficiently. Any help would be greatly appreciated. I am still learning regular expressions slowly but surely. Each tip gets added to my notes for future use.</p>
  
  <p>To further clarify, my above examples aren't the actual strings. The actual string would look like:</p>
  
  <pre><code>AG.av08_binloop_v6
  </code></pre>
  
  <p>With my desired output looking like:</p>
  
  <pre><code>AGAV08
  </code></pre>
  
  <p>And the next example would be the same. String:</p>
  
  <pre><code>TL.av1_binloopv2
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>TLAV1
  </code></pre>
  
  <p>Again, thanks all for the help!</p>